Skip to content

Commit d3dcbfd

Browse files
committed
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 <[email protected]> (cherry picked from commit 5b63a18)
1 parent a2b47b0 commit d3dcbfd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestHunspell.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.Map;
3232
import java.util.Set;
3333
import java.util.concurrent.CancellationException;
34+
import java.util.concurrent.TimeUnit;
3435
import java.util.concurrent.atomic.AtomicBoolean;
3536
import java.util.concurrent.atomic.AtomicInteger;
3637
import java.util.stream.Collectors;
@@ -74,7 +75,8 @@ public void testCustomCheckCanceledGivesPartialResult() throws Exception {
7475
};
7576

7677
Hunspell hunspell = new Hunspell(dictionary, RETURN_PARTIAL_RESULT, checkCanceled);
77-
assertEquals(expected, hunspell.suggest("apac"));
78+
// pass a long timeout so that slower CI servers are more predictable.
79+
assertEquals(expected, hunspell.suggest("apac", TimeUnit.DAYS.toMillis(1)));
7880

7981
counter.set(0);
8082
var e =

0 commit comments

Comments
 (0)