You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/12/26 16:31:23 UTC

svn commit: r1052898 - /lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java

Author: rmuir
Date: Sun Dec 26 15:31:22 2010
New Revision: 1052898

URL: http://svn.apache.org/viewvc?rev=1052898&view=rev
Log:
LUCENE-2819: don't report problems about threads that were spawned before our tests (such as eclipse test-runner threads)

Modified:
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=1052898&r1=1052897&r2=1052898&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java Sun Dec 26 15:31:22 2010
@@ -522,6 +522,13 @@ public abstract class LuceneTestCase ext
   // 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 test-runner 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.