Skip to content

Add AutomatonTestUtil.randomDeterminizedAutomaton() - #17088

Merged
romseygeek merged 1 commit into
apache:mainfrom
romseygeek:fix-postings-tester-determinize
Nov 27, 2026
Merged

romseygeek merged 1 commit into
apache:mainfrom
romseygeek:fix-postings-tester-determinize

Conversation

@romseygeek

@romseygeek romseygeek commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

We have a few tests that call AutomatonTestUtil.randomAutomaton() and then immediately determinize the returned Automaton. In rare cases this random Automaton is not determinizable within the usual work limit, which can make these tests flaky.

This adds a new method to AutomatonTestUtil that generates a random Automaton and determinizes it against the default work limit. If this results in a TooComplexToDeterminizeException, it catches the exception and tries again with a new randomly generated Automaton.

We have a few tests that call AutomatonTestUtil.randomAutomaton() and
then immediately determinize it.  In rare cases the random Automaton
is not determinizable within the usual work limit, which can make these
tests flaky.

This adds a new method to AutomatonTestUtil that generates a random
Automaton and determinizes it against the default work limit.  If this
results in a TooComplexToDeterminizeException, it catches the exception
and tries again.
@romseygeek romseygeek self-assigned this Nov 27, 2026
@romseygeek
romseygeek merged commit 9e9140c into apache:main Nov 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant