fix test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1718543 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-12-08 09:55:06 +00:00
parent 92b659ab9e
commit 118c79a3d6
1 changed files with 3 additions and 0 deletions

View File

@ -1845,6 +1845,9 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
iwc = new IndexWriterConfig(new MockAnalyzer(random())); iwc = new IndexWriterConfig(new MockAnalyzer(random()));
try { try {
iw = new IndexWriter(dir, iwc); iw = new IndexWriter(dir, iwc);
} catch (AssertionError ex) {
// This is fine: we tripped IW's assert that all files it's about to fsync do exist:
assertTrue(ex.getMessage().matches("file .* does not exist; files=\\[.*\\]"));
} catch (CorruptIndexException ex) { } catch (CorruptIndexException ex) {
// Exceptions are fine - we are running out of file handlers here // Exceptions are fine - we are running out of file handlers here
continue; continue;