diff --git a/buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java b/buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java index 12c60d4f6377a..02103f259760a 100644 --- a/buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java +++ b/buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java @@ -163,6 +163,10 @@ private static boolean shouldSkipThread(Thread thread) { if (thread instanceof ForkJoinWorkerThread) { return true; } + // skip Testcontainers threads + if (thread.getThreadGroup() != null && "testcontainers".equals(thread.getThreadGroup().getName())) { + return true; + } String threadName = thread.getName(); if (threadName != null) { // skip ClientTestFixtures.SCHEDULER threads @@ -189,6 +193,14 @@ private static boolean shouldSkipThread(Thread thread) { if (threadName.equals("OkHttp TaskRunner")) { return true; } + // skip JNA background thread + if (threadName.equals("JNA Cleaner")) { + return true; + } + // skip org.glassfish.grizzly.http.server.DefaultSessionManager thread pool + if (threadName.equals("Grizzly-HttpSession-Expirer")) { + return true; + } } return false; }