mirror of https://github.com/apache/lucene.git
Fix test to check for close / closing and wait for merge threads to close the writer if concurrency strikes
This commit is contained in:
parent
aeb9f6ce5b
commit
bd004d2c57
|
@ -113,9 +113,13 @@ public class TestConcurrentMergeScheduler extends LuceneTestCase {
|
||||||
ioe.printStackTrace(System.out);
|
ioe.printStackTrace(System.out);
|
||||||
}
|
}
|
||||||
failure.clearDoFail();
|
failure.clearDoFail();
|
||||||
assertTrue(writer.isClosed());
|
// make sure we are closed or closing - if we are unlucky a merge does
|
||||||
|
// the actual closing for us. this is rare but might happen since the
|
||||||
|
// tragicEvent is checked by IFD and that might throw during a merge
|
||||||
|
expectThrows(AlreadyClosedException.class, writer::ensureOpen);
|
||||||
// Abort should have closed the deleter:
|
// Abort should have closed the deleter:
|
||||||
assertTrue(writer.isDeleterClosed());
|
assertTrue(writer.isDeleterClosed());
|
||||||
|
writer.close(); // now wait for the close to actually happen if a merge thread did the close.
|
||||||
break outer;
|
break outer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue