gaurav-narula commented on code in PR #15987: URL: https://github.com/apache/kafka/pull/15987#discussion_r1605525333
########## 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: > 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. Sorry, I'm still confused. Why would another iteration over `handleEvents()` invoke the `doAnswer`? In other words, shouldn't `accumulator.take()` block since there are no more events? I'd imagine `EventAccumulator::take` to block on `condition.await()` after 8 events have been processed. -- 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