RivenSun2 commented on a change in pull request #11340:
URL: https://github.com/apache/kafka/pull/11340#discussion_r775930900



##########
File path: 
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
##########
@@ -2230,7 +2230,7 @@ public void testInvalidGroupMetadata() throws 
InterruptedException {
         MockClient client = new MockClient(time, metadata);
         initMetadata(client, Collections.singletonMap(topic, 1));
         KafkaConsumer<String, String> consumer = newConsumer(time, client, 
subscription, metadata,
-                new RoundRobinAssignor(), true, groupInstanceId);
+                new RoundRobinAssignor(), false, groupInstanceId);

Review comment:
       Because this testInvalidGroupMetadata deliberately calls `new 
MockTime()` to make `autoTickMs=0`, I cannot set autoTickMs to non-zero here.
   `() -> consumer.poll(Duration.ofSeconds(5))` this line of code will block, 
so that 
`assertThrows(ConcurrentModificationException.class,consumer::groupMetadata)` 
can pass,
   Then call `consumer.wakeup()` to make `() -> 
consumer.poll(Duration.ofSeconds(5))` throw `WakeupException` and exit blocking.
   `assertTrue(service.awaitTermination(10, TimeUnit.SECONDS))` can also be 
passed




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