test(processing): avoid flaky incremental index cursor ordering - #19857
Merged
kfaraz merged 1 commit intoAug 3, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates IncrementalIndexCursorFactoryTest.testSanity to avoid flaky assertions caused by nondeterministic row ordering from GroupingEngine.process when the underlying incremental index is not sorted by dimensions. It keeps validating both expected grouped rows while making the assertions order-independent.
Changes:
- Replace positional
results.get(i)assertions with order-independentanyMatchchecks against expectedResultRowarrays. - Add an inline comment explaining why result ordering is not guaranteed in this execution path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kfaraz
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
IncrementalIndexCursorFactoryTest.testSanityindependent of result sequence order.GroupingEngine.processreturns the raw grouped sequence and does not apply the query'sORDER BYpost-processing. When the incremental index is not sorted by dimensions, positional assertions on the returned rows are not valid.Evidence
The original failure occurred in the JDK 25 unit-test shard:
testSanity[1: onheap, sortByDim: false]null, but received the row beginning withhiBefore this change, the focused test was run 10 times locally on JDK 25 and reproduced the same failure twice. This confirms that the failure is nondeterministic rather than a deterministic assertion failure.
Changes
Replace positional row assertions with order-independent assertions while retaining validation of both expected result rows.
Tests
testSanityrepeated 10 times on JDK 25 after the change: 10/10 passed