Yunyung commented on code in PR #20168:
URL: https://github.com/apache/kafka/pull/20168#discussion_r2228628205


##########
tools/src/test/java/org/apache/kafka/tools/consumer/group/ResetConsumerGroupOffsetTest.java:
##########
@@ -659,6 +662,41 @@ public void 
testResetWithUnrecognizedNewConsumerOption(ClusterInstance cluster)
         assertThrows(OptionException.class, () -> 
getConsumerGroupService(cgcArgs));
     }
 
+    @ClusterTest(brokers = 3, serverProperties = {@ClusterConfigProperty(key = 
OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG, value = "2")})
+    public void testResetOffsetsWithPartitionNoneLeader(ClusterInstance 
cluster) throws Exception {
+        String group = generateRandomGroupId();
+        String topic = generateRandomTopic();
+        String[] args = buildArgsForGroup(cluster, group, "--topic", topic + 
":0,1,2",
+                "--to-earliest", "--execute");
+
+        try (Admin admin = cluster.admin();
+             ConsumerGroupCommand.ConsumerGroupService service = 
getConsumerGroupService(args)) {
+
+            admin.createTopics(singleton(new NewTopic(topic, 3, (short) 
1))).all().get();
+            produceConsumeAndShutdown(cluster, topic, group, 2, 
GroupProtocol.CLASSIC);
+            assertDoesNotThrow(() -> resetOffsets(service));
+            // shutdown a broker to make some partitions missing leader
+            cluster.shutdownBroker(0);

Review Comment:
   Should we wait to ensure it has shut down correctly?



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