Skip to content

Test fix: flaky doc-order assertions in TextToVectorUpdateProcessorTest - #4879

Open
dsmiley wants to merge 1 commit into
apache:mainfrom
dsmiley:flaky-texttovector-sort
Open

Test fix: flaky doc-order assertions in TextToVectorUpdateProcessorTest#4879
dsmiley wants to merge 1 commit into
apache:mainfrom
dsmiley:flaky-texttovector-sort

Conversation

@dsmiley

@dsmiley dsmiley commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The test's shared query helper ran q=*:* with no sort. Since : gives every doc the same score, the order between tied docs 98 and 99 was resolved by internal segment/merge timing rather than anything Solr guarantees -- causing intermittent failures under contended workers.

Add an explicit sort=id desc to make ordering deterministic, and swap the expected doc order in
processAtomicUpdate_shouldTriggerTheVectorizationAndFetchTheStoredContent, whose assertions had been keyed to the opposite (accidental) order.

found & fixed with AI

The test's shared query helper ran `q=*:*` with no sort. Since *:*
gives every doc the same score, the order between tied docs 98 and 99
was resolved by internal segment/merge timing rather than anything
Solr guarantees -- causing intermittent failures under contended
workers (e.g. crave, `-XX:ActiveProcessorCount=1`).

Add an explicit `sort=id desc` to make ordering deterministic, and
swap the expected doc order in
processAtomicUpdate_shouldTriggerTheVectorizationAndFetchTheStoredContent,
whose assertions had been keyed to the opposite (accidental) order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019n8pzT7WWNwf76ackKPyv3
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