jeffkbkim commented on code in PR #15987:
URL: https://github.com/apache/kafka/pull/15987#discussion_r1605519141


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/runtime/MultiThreadedEventProcessorTest.java:
##########
@@ -61,8 +61,11 @@ public DelayEventAccumulator(Time time, long takeDelayMs) {
 
         @Override
         public CoordinatorEvent take() {
-            time.sleep(takeDelayMs);
-            return super.take();
+            CoordinatorEvent event = super.take();

Review Comment:
   That's correct and was my initial confusion as well. The event processor 
shuts down at the end of the test so we have the processor thread still running 
when we perform the assertions.
   
   When we call
   ```
   long diff = time.milliseconds() - startMs;
   ```
   we may be at the point when we process the 8 events (diff == 800ms) or when 
the thread does another iteration over handleEvents(), which does another 
time.sleep() (diff == 900ms). This was causing the flakiness.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to