From 5b63a1879ddff8f230e0c1a5023243a2f45bf4f8 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Wed, 7 Jun 2023 14:10:44 +0200 Subject: [PATCH] TestHunspell: reduce the flakiness probability (#12351) * TestHunspell: reduce the flakiness probability We need to check how the timeout interacts with custom exception-throwing checkCanceled. The default timeout seems not enough for some CI agents, so let's increase it. Co-authored-by: Dawid Weiss --- .../org/apache/lucene/analysis/hunspell/TestHunspell.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 =