mirror of https://github.com/apache/lucene.git
LUCENE-6804: fix test bug, to properly handle tragic merge exceptions
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1703082 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a944ab17a7
commit
100a783ab2
|
@ -84,7 +84,13 @@ public class TestIndexWriterOutOfFileDescriptors extends LuceneTestCase {
|
|||
w.addDocument(docs.nextDoc());
|
||||
}
|
||||
dir.setRandomIOExceptionRateOnOpen(0.0);
|
||||
w.close();
|
||||
if (ms instanceof ConcurrentMergeScheduler) {
|
||||
((ConcurrentMergeScheduler) ms).sync();
|
||||
}
|
||||
// If exc hit CMS then writer will be tragically closed:
|
||||
if (w.getTragicException() == null) {
|
||||
w.close();
|
||||
}
|
||||
w = null;
|
||||
|
||||
// NOTE: This is O(N^2)! Only enable for temporary debugging:
|
||||
|
|
Loading…
Reference in New Issue