LUCENE-2819: don't report problems about threads that were spawned before our tests (such as eclipse test-runner threads)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1052898 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-12-26 15:31:22 +00:00
parent 315370dcbb
commit 5ee58ef139
1 changed files with 7 additions and 0 deletions

View File

@ -522,6 +522,13 @@ public abstract class LuceneTestCase extends Assert {
// 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.