From d3dcbfdfafc57e6e8bd51bf94b3ca326f46422e4 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 (cherry picked from commit 5b63a1879ddff8f230e0c1a5023243a2f45bf4f8) --- .../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 e160cd7851c..7bee301837f 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.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 void testCustomCheckCanceledGivesPartialResult() throws Exception { }; 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 =