Skip to content

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

Merged
dsmiley merged 1 commit into
apache:mainfrom
dsmiley:flaky-texttovector-sort
Sep 10, 2026
Merged

dsmiley merged 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

@ilariapet ilariapet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it!

@dsmiley
dsmiley merged commit 5c78401 into apache:main Sep 10, 2026
4 of 5 checks passed
@dsmiley
dsmiley deleted the flaky-texttovector-sort branch September 10, 2026 13:56
dsmiley added a commit that referenced this pull request Sep 11, 2026
…st (#4879)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 5c78401)
dsmiley added a commit that referenced this pull request Sep 14, 2026
…st (#4879)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 5c78401)
(cherry picked from commit 68b226d)
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.

2 participants