cadonna commented on code in PR #14912:
URL: https://github.com/apache/kafka/pull/14912#discussion_r1416941420


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumerTest.java:
##########
@@ -966,22 +967,25 @@ private void 
testUpdateFetchPositionsWithFetchCommittedOffsetsTimeout(boolean co
 
         consumer.assign(singleton(new TopicPartition("t1", 1)));
 
-        try (MockedConstruction<OffsetFetchApplicationEvent> ignored = 
offsetFetchEventMocker(committedFuture)) {
-            // Poll with 0 timeout to run a single iteration of the poll loop
-            consumer.poll(Duration.ofMillis(0));
+        try (MockedConstruction<FetchCommittedOffsetsApplicationEvent> ignored 
= offsetFetchEventMocker(committedFuture)) {
+            // Poll with 250ms timeout to run at least a single iteration of 
the poll loop

Review Comment:
   I think this comment is a bit misleading. As far as I understand, the poll 
duration is not increased to have more iterations in the poll loop but to give 
the call to poll time to update the positions.



##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumerTest.java:
##########
@@ -991,13 +995,16 @@ private void 
testRefreshCommittedOffsetsSuccess(Set<TopicPartition> partitions,
         CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> 
committedFuture = new CompletableFuture<>();
         committedFuture.complete(committedOffsets);
         consumer.assign(partitions);
-        try (MockedConstruction<OffsetFetchApplicationEvent> ignored = 
offsetFetchEventMocker(committedFuture)) {
-            // Poll with 0 timeout to run a single iteration of the poll loop
-            consumer.poll(Duration.ofMillis(0));
-
-            
verify(applicationEventHandler).add(ArgumentMatchers.isA(ValidatePositionsApplicationEvent.class));
-            
verify(applicationEventHandler).add(ArgumentMatchers.isA(OffsetFetchApplicationEvent.class));
-            
verify(applicationEventHandler).add(ArgumentMatchers.isA(ResetPositionsApplicationEvent.class));
+        try (MockedConstruction<FetchCommittedOffsetsApplicationEvent> ignored 
= offsetFetchEventMocker(committedFuture)) {
+            // Poll with 250ms timeout to run at least a single iteration of 
the poll loop

Review Comment:
   See my comment above.



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