chia7712 commented on code in PR #16499:
URL: https://github.com/apache/kafka/pull/16499#discussion_r1680116851


##########
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:
   I open https://issues.apache.org/jira/browse/KAFKA-17151 as follow-up



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

Reply via email to