javanna commented on code in PR #13472:
URL: https://github.com/apache/lucene/pull/13472#discussion_r1664646220


##########
lucene/core/src/test/org/apache/lucene/search/TestTaskExecutor.java:
##########
@@ -251,14 +271,15 @@ public void testInvokeAllDoesNotLeaveTasksBehind() {
     for (int i = 0; i < tasksWithNormalExit; i++) {
       callables.add(
           () -> {
-            tasksExecuted.incrementAndGet();
-            return null;
+            throw new AssertionError(
+                "must not be called since the first task failing cancels all 
subsequent tasks");
           });
     }
     expectThrows(RuntimeException.class, () -> 
taskExecutor.invokeAll(callables));
     assertEquals(1, tasksExecuted.get());
     // the callables are technically all run, but the cancelled ones will be 
no-op
-    assertEquals(100, tasksStarted.get());
+    // add one for the task the gets executed on the current thread

Review Comment:
   > We're testing this now I think. We check the the executed count is 1 and 
we assert that none of the tasks are run after the cancelled one. So by 
definition that includes the tasks running on the caller thread?
   
   My concern was that the last task does not go through the executor and we 
don't really know if it was executed nor started? If we wanted that, perhaps we 
should call invokeAll from within the executor itself?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to