Skip to content

Commit 989e48a

Browse files
committed
Address test failure in BlockPostingsFormat3Tests
1 parent 89c4af7 commit 989e48a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

x-pack/plugin/old-lucene-versions/src/test/java/org/elasticsearch/xpack/lucene/bwc/codecs/lucene50/BlockPostingsFormat3Tests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
import org.apache.lucene.tests.util.TestUtil;
4949
import org.apache.lucene.tests.util.automaton.AutomatonTestUtil;
5050
import org.apache.lucene.util.BytesRef;
51+
import org.apache.lucene.util.automaton.Automaton;
5152
import org.apache.lucene.util.automaton.CompiledAutomaton;
53+
import org.apache.lucene.util.automaton.Operations;
5254
import org.apache.lucene.util.automaton.RegExp;
5355
import org.elasticsearch.test.ESTestCase;
5456

@@ -187,7 +189,11 @@ public void assertTerms(Terms leftTerms, Terms rightTerms, boolean deep) throws
187189
int numIntersections = atLeast(3);
188190
for (int i = 0; i < numIntersections; i++) {
189191
String re = AutomatonTestUtil.randomRegexp(random());
190-
CompiledAutomaton automaton = new CompiledAutomaton(new RegExp(re, RegExp.NONE).toAutomaton());
192+
Automaton determinized = Operations.determinize(
193+
new RegExp(re, RegExp.NONE).toAutomaton(),
194+
Operations.DEFAULT_DETERMINIZE_WORK_LIMIT
195+
);
196+
CompiledAutomaton automaton = new CompiledAutomaton(determinized);
191197
if (automaton.type == CompiledAutomaton.AUTOMATON_TYPE.NORMAL) {
192198
// TODO: test start term too
193199
TermsEnum leftIntersection = leftTerms.intersect(automaton, null);

0 commit comments

Comments
 (0)