mirror of https://github.com/apache/lucene.git
prevent false test failure in testThreadInterruptDeadlock: force ThreadInterruptedException to be loaded up-front
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@993287 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
89c6fea889
commit
77830a0fc4
|
@ -4467,6 +4467,12 @@ public class TestIndexWriter extends LuceneTestCase {
|
|||
IndexerThreadInterrupt t = new IndexerThreadInterrupt();
|
||||
t.setDaemon(true);
|
||||
t.start();
|
||||
|
||||
// Force class loader to load ThreadInterruptedException
|
||||
// up front... else we can see a false failure if 2nd
|
||||
// interrupt arrives while class loader is trying to
|
||||
// init this class (in servicing a first interrupt):
|
||||
assertTrue(new ThreadInterruptedException(new InterruptedException()).getCause() instanceof InterruptedException);
|
||||
|
||||
// issue 100 interrupts to child thread
|
||||
int i = 0;
|
||||
|
|
Loading…
Reference in New Issue