You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2023/10/30 21:03:56 UTC
(pulsar) branch master updated: [improve][ci] Ignore Testcontainers background threads in ThreadLeakDetectorListener (#21472)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new bc84721694a [improve][ci] Ignore Testcontainers background threads in ThreadLeakDetectorListener (#21472)
bc84721694a is described below
commit bc84721694aa0e7d42b1ccc1cc6af378f48350eb
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Mon Oct 30 23:03:49 2023 +0200
[improve][ci] Ignore Testcontainers background threads in ThreadLeakDetectorListener (#21472)
---
.../org/apache/pulsar/tests/ThreadLeakDetectorListener.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
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 12c60d4f637..02103f25976 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 @@ public class ThreadLeakDetectorListener extends BetweenTestClassesListenerAdapte
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 @@ public class ThreadLeakDetectorListener extends BetweenTestClassesListenerAdapte
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;
}