jtuglu-netflix commented on code in PR #18060:
URL: https://github.com/apache/druid/pull/18060#discussion_r2119968113
##########
indexing-service/src/test/java/org/apache/druid/indexing/overlord/TaskQueueConcurrencyTest.java:
##########
@@ -77,7 +80,20 @@ public void setUpIngestionTestBase() throws IOException
@Override
public ListenableFuture<TaskStatus> run(Task task)
{
- return Futures.immediateFuture(TaskStatus.success(task.getId()));
+ // Skip the initialization; we just need to simulate a delayed
future
+ Preconditions.checkArgument(task instanceof NoopTask, "task must
be an instance of NoopTask");
+ final SettableFuture<TaskStatus> future = SettableFuture.create();
+
+ taskExecutor.submit(() -> {
+ try {
+ TaskStatus status = ((NoopTask) task).runTask(null);
+ future.set(status);
+ }
+ catch (Exception e) {
+ future.setException(e);
+ }
+ });
+ return future;
Review Comment:
This is needed because there's no point in measuring concurrency if you have
no control over the blocking nature of the callbacks. Without a way to
parameterize the task run time, you effectively negate any blocking effects of
callbacks (which might reveal concurrency bugs themselves), since they execute
immediately, which is not at all how the production code runs. This leads to
the flakes, etc. that I'm trying to fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]