gharris1727 commented on code in PR #16499: URL: https://github.com/apache/kafka/pull/16499#discussion_r1680088442
########## core/src/test/java/kafka/test/junit/ClusterTestExtensions.java: ########## @@ -119,7 +138,21 @@ public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContex return generatedContexts.stream(); } + @Override + public void beforeEach(ExtensionContext context) { + detectThreadLeak = DetectThreadLeak.of(thread -> + SKIPPED_THREAD_PREFIX.stream().noneMatch(prefix -> thread.getName().startsWith(prefix))); + } + @Override + public void afterEach(ExtensionContext context) throws InterruptedException { + if (detectThreadLeak == null) { + return; + } + TestUtils.waitForCondition(() -> detectThreadLeak.newThreads().isEmpty(), Review Comment: > that will make this PR pending for a while. I took the strategy of fixing the leaks before enforcement with #14783 and it is true that PR has been open a long time at this point. I don't think that's necessarily a problem, as a ton of leaks have already been addressed. Since this is a replacement for the existing verifyNoUnexpectedThreads that I just want gone asap, i'm fine with this as an intermediate. -- 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