You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SearchSourceBuilderTests generates random suggest builders via PhraseSuggestionBuilderTests.randomPhraseSuggestionBuilder(), which calls maybeSet(testBuilder::realWordErrorLikelihood, randomFloat()). randomFloat() can return exactly 0.0, and PhraseSuggestionBuilder.realWordErrorLikelihood rejects <= 0.0 with real_word_error_likelihood must be > 0.0.
The sibling line for maxErrors was already guarded with Math.max(randomFloat(), Float.MIN_NORMAL). realWordErrorLikelihood was missed. This is a test-data bug, not a production bug.
Release risk: low-risk
The failure is a rare random-value edge case (0.0 float) in test generation. Production validation behaves as designed. It would only change if the production setter were also hit by real inputs, which isn't indicated.
Reproduction verdict: not reproduced, so confidence rests on code inspection. The exception text matches the setter exactly, and the maxErrors line shows this class of bug was fixed before.
Codebase investigation: server/src/test/.../suggest/phrase/PhraseSuggestionBuilderTests.java:39 and PhraseSuggestionBuilder.java:248-252. The confidence setter on the next line may need a similar check, so verify it.
Recent git history: not inspected (the shared git mirror was unreadable).
Proposed fix: change line 39 to maybeSet(testBuilder::realWordErrorLikelihood, Math.max(randomFloat(), Float.MIN_NORMAL));. Validate by running :server:test --tests "*PhraseSuggestionBuilderTests" --tests "*SearchSourceBuilderTests" a few hundred times, then remove the muted-tests.yml entry for SearchSourceBuilderTests.testSupportsParallelCollection.
Effort estimate: trivial — a one-line test change.
Confidence: 0.80 (high) — the exception message matches the generator exactly. The gap is that the failing seed did not reproduce.
Generated by test-analysis · archimedes v1.3.0 · openrouter/anthropic/claude-sonnet-5.5
The analysis correctly identified that PhraseSuggestionBuilderTests.randomPhraseSuggestionBuilder() could generate realWordErrorLikelihood = 0.0 via randomFloat(), matching the sibling maxErrors guard pattern — the merged fix applied exactly the proposed Math.max(randomFloat(), Float.MIN_NORMAL) guard and removed the mute entry.
Generated by review-test-analysis · archimedes v1.3.0 · agent-router/claude-sonnet-5
Activity
elasticsearchmachine commentedon Oct 26, 2026
Pinging @elastic/es-search-infra (Team:Search Foundations)
Mute org.elasticsearch.search.builder.SearchSourceBuilderTests testSu…
infra-vault-gh-plugin-prod commentedon Oct 26, 2026
This has been muted on branch main
Mute Reasons:
Muted tasks:
:server:testBuild Scans:
elasticsearchmachine commentedon Oct 26, 2026
Test Failure Analysis
Summary
SearchSourceBuilderTestsgenerates random suggest builders viaPhraseSuggestionBuilderTests.randomPhraseSuggestionBuilder(), which callsmaybeSet(testBuilder::realWordErrorLikelihood, randomFloat()).randomFloat()can return exactly0.0, andPhraseSuggestionBuilder.realWordErrorLikelihoodrejects<= 0.0withreal_word_error_likelihood must be > 0.0.maxErrorswas already guarded withMath.max(randomFloat(), Float.MIN_NORMAL).realWordErrorLikelihoodwas missed. This is a test-data bug, not a production bug.Release risk: low-risk
Impact
Reproduction
./gradlew ":server:test" --tests "org.elasticsearch.search.builder.SearchSourceBuilderTests.testSupportsParallelCollection" -Dtests.seed=611D4D0204011623 -Dtests.locale=so-KE -Dtests.timezone=America/Caracas -Druntime.java=27Mitigation Proposal
maxErrorsline shows this class of bug was fixed before.server/src/test/.../suggest/phrase/PhraseSuggestionBuilderTests.java:39andPhraseSuggestionBuilder.java:248-252. Theconfidencesetter on the next line may need a similar check, so verify it.maybeSet(testBuilder::realWordErrorLikelihood, Math.max(randomFloat(), Float.MIN_NORMAL));. Validate by running:server:test --tests "*PhraseSuggestionBuilderTests" --tests "*SearchSourceBuilderTests"a few hundred times, then remove themuted-tests.ymlentry forSearchSourceBuilderTests.testSupportsParallelCollection.Prevent invalid random value in PhraseSuggestionBuilderTests
Prevent invalid random value in PhraseSuggestionBuilderTests (#163423)
elasticsearchmachine commentedon Oct 26, 2026
Test Analysis Accuracy Review
0.95low-riskrisk ·test_hardeningtest_hardening— #163423The analysis correctly identified that
PhraseSuggestionBuilderTests.randomPhraseSuggestionBuilder()could generaterealWordErrorLikelihood = 0.0viarandomFloat(), matching the siblingmaxErrorsguard pattern — the merged fix applied exactly the proposedMath.max(randomFloat(), Float.MIN_NORMAL)guard and removed the mute entry.Prevent invalid random value in PhraseSuggestionBuilderTests (#163423) (
Prevent invalid random value in PhraseSuggestionBuilderTests (#163423) (
Prevent invalid random value in PhraseSuggestionBuilderTests (#163423) (
Prevent invalid random value in PhraseSuggestionBuilderTests (#163423) (