Skip to content

Apache Lucene open-source search software

fix false random test failure

Michael McCandless2f649441fb9f
diff --git a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 8992d485323..caf92ed3130 100644
--- a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -372,7 +372,6 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
Directory dir = FSDirectory.open(new File(dirName));
// open writer
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new MockAnalyzer()).setOpenMode(OpenMode.APPEND));
-
// add 10 docs
for(int i=0;i<10;i++) {
addDoc(writer, 35+i);
@@ -381,11 +380,11 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
// make sure writer sees right total -- writer seems not to know about deletes in .del?
final int expected;
if (compare(origDirName, "24") < 0) {
- expected = 45;
+ expected = 44;
} else {
- expected = 46;
+ expected = 45;
}
- assertEquals("wrong doc count", expected, writer.maxDoc());
+ assertEquals("wrong doc count", expected, writer.numDocs());
writer.close();
// make sure searching sees right # hits