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


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java:
##########
@@ -239,10 +241,30 @@ public void shouldAddAndRemoveThreadsMultipleTimes() 
throws InterruptedException
             final CountDownLatch latch = new CountDownLatch(2);
             final Thread one = adjustCountHelperThread(kafkaStreams, 4, latch);
             final Thread two = adjustCountHelperThread(kafkaStreams, 6, latch);
-            two.start();
-            one.start();
-            latch.await(30, TimeUnit.SECONDS);
-            assertThat(kafkaStreams.metadataForLocalThreads().size(), 
equalTo(oldThreadCount));
+            Set<ThreadMetadata> threadMetadata = null;
+
+            AssertionError testError = null;
+            try {
+                two.start();
+                one.start();
+
+                assertTrue(latch.await(30, TimeUnit.SECONDS));
+                one.join();

Review Comment:
   > and fixing thread resource leak.
   
   Don't think the `join()` order matters? But before, we did not join the 
threads at all?
   
   Each thread count down the latch right before it exits, and we wait for the 
latch above.



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