lianetm commented on code in PR #20521:
URL: https://github.com/apache/kafka/pull/20521#discussion_r2411698347


##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/PlaintextConsumerCommitTest.java:
##########
@@ -283,11 +283,13 @@ public void 
onPartitionsRevoked(Collection<TopicPartition> partitions) {
             // In both CLASSIC and CONSUMER protocols, interceptors are 
executed in poll and close.
             // However, in the CONSUMER protocol, the assignment may be 
changed outside a poll, so
             // we need to poll once to ensure the interceptor is called.
-            if (groupProtocol == GroupProtocol.CONSUMER) {
-                consumer.poll(Duration.ZERO);
-            }
-
-            assertTrue(MockConsumerInterceptor.ON_COMMIT_COUNT.intValue() > 
commitCountBeforeRebalance);
+            TestUtils.waitForCondition(
+                () -> {
+                    consumer.poll(Duration.ZERO);
+                    return MockConsumerInterceptor.ON_COMMIT_COUNT.intValue() 
> commitCountBeforeRebalance;
+                },
+                "Consumer.poll() did not invoke onCommit() before timeout 
elapse"
+            );

Review Comment:
   is this change needed after the update where you moved the 
callbacks/interceptor invocation to the app thread? 
(https://github.com/kirktrue/kafka/blob/5215030a4c94efb0ba0fc6107e8022cf8404dfdb/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L897-L898)



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