chia7712 commented on code in PR #15679: URL: https://github.com/apache/kafka/pull/15679#discussion_r1573834240
########## tools/src/test/java/org/apache/kafka/tools/consumer/group/DeleteOffsetsConsumerGroupCommandIntegrationTest.java: ########## @@ -173,7 +208,11 @@ private void produceRecord() { private void withStableConsumerGroup(Runnable body) { Consumer<byte[], byte[]> consumer = createConsumer(new Properties()); try { - TestUtils.subscribeAndWaitForRecords(TOPIC, consumer, DEFAULT_MAX_WAIT_MS); + consumer.subscribe(Collections.singletonList(TOPIC)); + ConsumerRecords<byte[], byte[]> records = consumer.poll(Duration.ofMillis(DEFAULT_MAX_WAIT_MS)); + if (records.isEmpty()) { Review Comment: Could we rewrite it by `assertNotEquals(0, records.count())`? ########## tools/src/test/java/org/apache/kafka/tools/consumer/group/DeleteOffsetsConsumerGroupCommandIntegrationTest.java: ########## @@ -184,7 +223,11 @@ private void withStableConsumerGroup(Runnable body) { private void withEmptyConsumerGroup(Runnable body) { Consumer<byte[], byte[]> consumer = createConsumer(new Properties()); Review Comment: please use try-with-resources ########## tools/src/test/java/org/apache/kafka/tools/consumer/group/DeleteOffsetsConsumerGroupCommandIntegrationTest.java: ########## @@ -173,7 +208,11 @@ private void produceRecord() { private void withStableConsumerGroup(Runnable body) { Consumer<byte[], byte[]> consumer = createConsumer(new Properties()); Review Comment: please use try-with-resources -- 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