fix testGroupByLevel2Series2Devices3Regions #16613
Open
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.
Fix Non-Deterministic Behavior in AggregationDistributionTest.testGroupByLevel2Series2Devices3Regions
Problem
The test
testGroupByLevel2Series2Devices3Regionswas failing non-deterministically under NonDex with a 60% failure rate (3 out of 5 runs) due to order-dependent fragment access and assumptions about node positions in the plan tree.Way to Reproduce
Root Cause
The test made multiple order-dependent assumptions:
get(0),get(2))GroupByLevelNodeis always at specific child positionsinstanceofchecks at fixed depth levelsWhen NonDex shuffled collection iteration order, fragments appeared in different sequences and with varying tree structures, causing failures despite the query plan being semantically correct.
Solution
Made the test order-independent by searching all fragments for expected patterns instead of relying on fixed positions:
1. Added Helper Method for Tree Search
2. Changed from Position-Based to Pattern-Based Verification
Before (Order-Dependent):
After (Order-Independent):
Key Improvements:
findFirstNodeOfType()to locateGroupByLevelNodeat any depthVerification
Tested with 50 NonDex runs - 0 failures (100% success rate):
mvn edu.illinois:nondex-maven-plugin:2.1.1:nondex \ -Dtest=AggregationDistributionTest#testGroupByLevel2Series2Devices3Regions \ -DnondexRuns=50 # Result: 0 failuresKey Changed Classes
testGroupByLevel2Series2Devices3Regionsto use order-independent verificationfindFirstNodeOfType()helper method for recursive node search at any depthcountNodesOfType()helper method