squah-confluent commented on code in PR #24348:
URL: https://github.com/apache/kafka/pull/24348#discussion_r4667340037


##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/ShareConsumerTest.java:
##########
@@ -1886,7 +1886,14 @@ public void testShareConsumerAfterCoordinatorMovement() 
throws Exception {
         );
 
         // top the producer after some time (but after coordinator shutdown)
-        service.schedule(() -> prodState.done().set(true), 10L, 
TimeUnit.SECONDS);
+        // The consumer stops at its first empty poll after the producer 
stops, so the producer must not
+        // stop before the consumer receives its assignment. In the worst case 
this can take more than
+        // 10 seconds:
+        //   Heartbeat 1 at +0 seconds sends the subscription and triggers an 
assignor run.
+        //     multipart is not yet ready, so the assignor returns an empty 
assignment.
+        //   Heartbeat 2 at +5 seconds triggers another assignor run now that 
multipart is assignable.
+        //   Heartbeat 3 at +10 seconds receives the assignment with multipart.

Review Comment:
   I'm intentionally ignoring the acknowledgement heartbeats in this analysis 
for simplicitly, since their timing depends on the poll interval.



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