Skip to content

Apache Lucene open-source search software

LUCENE-4469: fix these tests to actually fail if checkindex fails

Robert Muireeb64dca34d7
diff --git a/lucene/codecs/src/test/org/apache/lucene/codecs/pulsing/TestPulsingReuse.java b/lucene/codecs/src/test/org/apache/lucene/codecs/pulsing/TestPulsingReuse.java
index a37770d31c3..488fca34baf 100644
--- a/lucene/codecs/src/test/org/apache/lucene/codecs/pulsing/TestPulsingReuse.java
+++ b/lucene/codecs/src/test/org/apache/lucene/codecs/pulsing/TestPulsingReuse.java
@@ -85,7 +85,6 @@ public class TestPulsingReuse extends LuceneTestCase {
// we always run this test with pulsing codec.
Codec cp = _TestUtil.alwaysPostingsFormat(new NestedPulsingPostingsFormat());
BaseDirectoryWrapper dir = newDirectory();
- dir.setCheckIndexOnClose(false); // will do this ourselves, custom codec
RandomIndexWriter iw = new RandomIndexWriter(random(), dir,
newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).setCodec(cp));
Document doc = new Document();
@@ -119,8 +118,6 @@ public class TestPulsingReuse extends LuceneTestCase {
assertEquals(4, allEnums.size());
ir.close();
- CheckIndex ci = new CheckIndex(dir);
- ci.checkIndex(null);
dir.close();
}
}
diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java
index f5a308ca65f..af2be9e0e02 100644
--- a/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java
+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java
@@ -48,7 +48,6 @@ public class Test2BPostings extends LuceneTestCase {
if (dir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper)dir).setThrottling(MockDirectoryWrapper.Throttling.NEVER);
}
- dir.setCheckIndexOnClose(false); // don't double-checkindex
IndexWriter w = new IndexWriter(dir,
new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()))
@@ -80,11 +79,6 @@ public class Test2BPostings extends LuceneTestCase {
}
w.forceMerge(1);
w.close();
- CheckIndex ci = new CheckIndex(dir);
- if (VERBOSE) {
- ci.setInfoStream(System.out);
- }
- ci.checkIndex();
dir.close();
}