From 5e0761eab510f695806fdc3b51d0e9ea85497a34 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Sun, 23 Apr 2023 21:16:56 +0200 Subject: [PATCH] remove timeout dependency from TestHunspell.testSuggestionOrderStabilityOnDictionaryEditing --- .../apache/lucene/analysis/hunspell/TestHunspell.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 f7170bc80e2..d7bf91f8c21 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 @@ -166,7 +166,10 @@ public class TestHunspell extends LuceneTestCase { } private Hunspell loadNoTimeout(String name) throws Exception { - Dictionary dictionary = loadDictionary(false, name + ".aff", name + ".dic"); + return loadNoTimeout(loadDictionary(false, name + ".aff", name + ".dic")); + } + + private static Hunspell loadNoTimeout(Dictionary dictionary) { return new Hunspell(dictionary, TimeoutPolicy.NO_TIMEOUT, () -> {}); } @@ -265,8 +268,8 @@ public class TestHunspell extends LuceneTestCase { assertFalse(new Hunspell(small).spell(original)); - List smallSug = new Hunspell(small).suggest(original); - List largerSug = new Hunspell(larger).suggest(original); + List smallSug = loadNoTimeout(small).suggest(original); + List largerSug = loadNoTimeout(larger).suggest(original); assertEquals(smallSug.toString(), 4, smallSug.size()); assertEquals(smallSug, largerSug); }