gaurav-narula commented on code in PR #15987:
URL: https://github.com/apache/kafka/pull/15987#discussion_r1605530429


##########
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:
   IIUC, it's the ordering that matters so we can avoid the null check and 
increment time only after `super.take()` returns.
   
   ```java
               CoordinatorEvent event = super.take(); // blocks until there are 
new events
               time.sleep(takeDelayMs); // only increment timer after we get 
unblocked
               return event;
   ```



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