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 <dawid.weiss@gmail.com>
This commit is contained in:
Peter Gromov 2023-06-07 14:10:44 +02:00 committed by GitHub
parent 0c293909c0
commit 5b63a1879d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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 =