Apache Lucene open-source search software
prevent false test failure in testThreadInterruptDeadlock: force ThreadInterruptedException to be loaded up-front
Michael McCandless77830a0fc40f
diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.javaindex 5fc6a39f079..97511437b71 100644--- a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java+++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java@@ -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 threadint i = 0;