lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: LuceneTestCase.threadCleanup incorrectly reports left running threads
Date Wed, 22 Dec 2010 19:35:16 GMT
here is a (imperfect) patch for eclipse, can you try this? any threads
running at this point are not our own.

Index: lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
===================================================================
--- lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
(revision 1051872)
+++ lucene/src/test/org/apache/lucene/util/LuceneTestCase.java  (working copy)
@@ -522,6 +522,13 @@
   // jvm-wide list of 'rogue threads' we found, so they only get reported once.
   private final static IdentityHashMap<Thread,Boolean> rogueThreads =
new IdentityHashMap<Thread,Boolean>();

+  static {
+    // just a hack for things like eclipse threads
+    for (Thread t : Thread.getAllStackTraces().keySet()) {
+      rogueThreads.put(t, true);
+    }
+  }
+
   /**
    * Looks for leftover running threads, trying to kill them off,
    * so they don't fail future tests.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message