Skip to content

test(processing): avoid flaky incremental index cursor ordering - #19857

Merged
kfaraz merged 1 commit into
apache:masterfrom
FrankChen021:codex/fix-incremental-index-order
Aug 3, 2026
Merged

test(processing): avoid flaky incremental index cursor ordering#19857
kfaraz merged 1 commit into
apache:masterfrom
FrankChen021:codex/fix-incremental-index-order

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

Summary

Make IncrementalIndexCursorFactoryTest.testSanity independent of result sequence order.

GroupingEngine.process returns the raw grouped sequence and does not apply the query's ORDER BY post-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:

  • Failed CI job
  • Failing case: testSanity[1: onheap, sortByDim: false]
  • Failure: expected the row beginning with null, but received the row beginning with hi

Before 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

  • Focused parameterized class: 16 tests, 0 failures, 1 skipped
  • Focused testSanity repeated 10 times on JDK 25 after the change: 10/10 passed

@FrankChen021
FrankChen021 marked this pull request as ready for review August 2, 2026 14:15
Copilot AI review requested due to automatic review settings August 2, 2026 14:15

Copilot AI 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.

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-independent anyMatch checks against expected ResultRow arrays.
  • 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
kfaraz merged commit ca0064e into apache:master Aug 3, 2026
28 checks passed
@github-actions github-actions Bot added this to the 39.0.0 milestone Aug 3, 2026
@FrankChen021
FrankChen021 deleted the codex/fix-incremental-index-order branch August 3, 2026 05:21
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.

3 participants