Skip to content

Apache Lucene open-source search software

Fix TestForTooMuchCloning flakiness (#14232)

Benjamin Trentde8e3785832b
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java b/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java
index 92470083540..eadf9960518 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java
@@ -42,6 +42,8 @@ public class TestForTooMuchCloning extends LuceneTestCase {
random(),
dir,
newIndexWriterConfig(new MockAnalyzer(random()))
+ // to reduce flakiness on merge clone count
+ .setMergeScheduler(new SerialMergeScheduler())
.setMaxBufferedDocs(2)
// use a FilterMP otherwise RIW will randomly reconfigure
// the MP while the test runs
@@ -62,7 +64,7 @@ public class TestForTooMuchCloning extends LuceneTestCase {
// System.out.println("merge clone count=" + cloneCount);
assertTrue(
"too many calls to IndexInput.clone during merging: " + dir.getInputCloneCount(),
- dir.getInputCloneCount() < 500);
+ dir.getInputCloneCount() < 600);
final IndexSearcher s = newSearcher(r);
// important: set this after newSearcher, it might have run checkindex