lucasbru commented on code in PR #19617:
URL: https://github.com/apache/kafka/pull/19617#discussion_r2072902337
##########
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:
I would have just expected the `join`s to be after the assertion, if you
want to fix just a thread leak problem and preserve the test otherwise. still,
LGTM
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]