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:
Michael McCandless 2015-09-15 01:19:20 +00:00
parent a944ab17a7
commit 100a783ab2
1 changed files with 7 additions and 1 deletions

View File

@ -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: