Skip to content

Fix flaky test TestIndexOptions > testMultiValueForcesDeoptimization#16315

Merged
dweiss merged 3 commits into
apache:mainfrom
neoremind:i_16309
Jul 1, 2026
Merged

Fix flaky test TestIndexOptions > testMultiValueForcesDeoptimization#16315
dweiss merged 3 commits into
apache:mainfrom
neoremind:i_16309

Conversation

@neoremind

@neoremind neoremind commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Address #16309.

The test assumes a single segment but newIndexWriterConfig() can randomize maxBufferedDocs to a small value (2-15), the test creates 4 docs, with specific seed, it causes flush that creates multiple segments. Fix by calling forceMerge(1) before opening the reader.

Verified the fix by running below command which has the failing seed:

./gradlew :lucene:core:test --tests "org.apache.lucene.index.TestIndexOptions.testMultiValueForcesDeoptimization" -Ptests.asserts=true -Ptests.file.encoding=UTF-8 -Ptests.gui=true -Ptests.jvmargs= -Ptests.jvms=4 -Ptests.seed=9D72F1A3BE205450 -Ptests.vectorsize=256

@dweiss dweiss linked an issue Jul 1, 2026 that may be closed by this pull request
@dweiss

dweiss commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for fixing those test failures! I'll wait for builds to pass and merge.

@dweiss dweiss merged commit 88f7919 into apache:main Jul 1, 2026
13 checks passed
dweiss added a commit that referenced this pull request Jul 1, 2026
…16315)

* Fix flaky test TestIndexOptions > testMultiValueForcesDeoptimization

* Update CHANGES.txt

---------

Co-authored-by: Xu Zhang <zhangxuv@amazon.com>
Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
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.

Seen a Flaky test TestIndexOptions > testMultiValueForcesDeoptimization

2 participants