rodesai commented on a change in pull request #11149:
URL: https://github.com/apache/kafka/pull/11149#discussion_r696290580



##########
File path: 
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
##########
@@ -1925,6 +1926,56 @@ public void testCommittedAuthenticationFailure() {
         assertThrows(AuthenticationException.class, () -> 
consumer.committed(Collections.singleton(tp0)).get(tp0));
     }
 
+    @Test
+    public void testMeasureCommitSyncDuration() {
+        // use a consumer that will throw to ensure we return quickly
+        Time time = new MockTime(Duration.ofSeconds(1).toMillis());
+        SubscriptionState subscription = new SubscriptionState(new 
LogContext(), OffsetResetStrategy.EARLIEST);
+        ConsumerMetadata metadata = createMetadata(subscription);
+        MockClient client = new MockClient(time, metadata);
+        initMetadata(client, singletonMap(topic, 1));
+        Node node = metadata.fetch().nodes().get(0);
+        ConsumerPartitionAssignor assignor = new RangeAssignor();
+        client.createPendingAuthenticationError(node, 0);
+        final KafkaConsumer<String, String> consumer
+            = newConsumer(time, client, subscription, metadata, assignor, 
false, groupInstanceId);

Review comment:
       refactored




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