ahmedabu98 commented on code in PR #40201:
URL: https://github.com/apache/beam/pull/40201#discussion_r4065013258


##########
sdks/java/io/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/BoundedAsyncTasksTest.java:
##########
@@ -88,14 +88,14 @@ public void testOutOfOrderCompletionDrainsFinishedTasks() 
throws Exception {
         },
         delivered::add);
 
-    // Wait until fast task has finished running in the background
+    // The latch fires inside the task body; the future is marked done a 
moment later, so a
+    // single drain can miss it. Drain until it shows up while "slow" is still 
blocked.
     fastTaskDone.await();
-
-    // Trigger a drain by submitting another task
     tasks.submit(() -> "noop", delivered::add);
-
-    // "fast" should have been drained while "slow" is still blocked
-    assertTrue(delivered.contains("fast"));
+    while (!delivered.contains("fast")) {
+      Thread.sleep(1);
+      tasks.drainFinished(delivered::add);
+    }

Review Comment:
   Include a max retry just in case?



-- 
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]

Reply via email to