Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

fix test bug

Michael McCandless118c79a3d65f
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
index 01ce17fd6f2..dbcc755b792 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
@@ -1845,6 +1845,9 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
iwc = new IndexWriterConfig(new MockAnalyzer(random()));
try {
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) {
// Exceptions are fine - we are running out of file handlers here
continue;