Skip to content

Apache Lucene open-source search software

TestHunspell: reduce the flakiness probability (#12351)

Peter Gromov5b63a1879ddf
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java
index d7bf91f8c21..ec1af2fd96a 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java
@@ -31,6 +31,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CancellationException;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -74,7 +75,8 @@ public class TestHunspell extends LuceneTestCase {
};
Hunspell hunspell = new Hunspell(dictionary, RETURN_PARTIAL_RESULT, checkCanceled);
- assertEquals(expected, hunspell.suggest("apac"));
+ // pass a long timeout so that slower CI servers are more predictable.
+ assertEquals(expected, hunspell.suggest("apac", TimeUnit.DAYS.toMillis(1)));
counter.set(0);
var e =