mjsax commented on code in PR #20320:
URL: https://github.com/apache/kafka/pull/20320#discussion_r2268206616


##########
tools/src/test/java/org/apache/kafka/tools/streams/DescribeStreamsGroupTest.java:
##########
@@ -252,10 +255,17 @@ public void testDescribeNonExistingStreamsGroup() {
     }
 
     @Test
-    public void testDescribeStreamsGroupWithShortTimeout() {
+    public void testDescribeStreamsGroupWithShortTimeout() throws Exception {
+        cluster.createTopic(INPUT_TOPIC_2, 1, 1);
+        KafkaStreams streams2 = new KafkaStreams(topology(INPUT_TOPIC_2, 
OUTPUT_TOPIC_2), streamsProp(APP_ID_2));

Review Comment:
   We should use try-with-resource.



##########
tools/src/test/java/org/apache/kafka/tools/streams/DescribeStreamsGroupTest.java:
##########
@@ -252,10 +255,17 @@ public void testDescribeNonExistingStreamsGroup() {
     }
 
     @Test
-    public void testDescribeStreamsGroupWithShortTimeout() {
+    public void testDescribeStreamsGroupWithShortTimeout() throws Exception {
+        cluster.createTopic(INPUT_TOPIC_2, 1, 1);
+        KafkaStreams streams2 = new KafkaStreams(topology(INPUT_TOPIC_2, 
OUTPUT_TOPIC_2), streamsProp(APP_ID_2));
+        startApplicationAndWaitUntilRunning(streams2);
+
         List<String> args = List.of("--bootstrap-server", bootstrapServers, 
"--describe", "--members", "--verbose", "--group", APP_ID, "--timeout", "1");
         Throwable e = assertThrows(ExecutionException.class, () -> 
getStreamsGroupService(args.toArray(new String[0])).describeGroups());
         assertEquals(TimeoutException.class, e.getCause().getClass());
+
+        streams2.close();
+        streams2.cleanUp();

Review Comment:
   If we use try-with-resource, we can remove `close()` and put `cleanUp()` 
into finally-block.



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