Uh oh!
There was an error while loading. Please reload this page.
test(integ-test): stabilize deterministic fixtures across shards - #5730
test(integ-test): stabilize deterministic fixtures across shards#5730mengweieric wants to merge 6 commits into
Conversation
Select fixture rows by unique keys, compare unordered collections as multisets, and use numeric tolerances where distributed accumulation or encoding is lossy. Keep exact schema, cardinality, and source-value assertions. Signed-off-by: Eric Wei <menwe@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 31f8a2a)Here are some key observations to aid the review process:
|
Signed-off-by: Eric Wei <menwe@amazon.com>
Signed-off-by: Eric Wei <menwe@amazon.com>
Persistent review updated to latest commit 60e3690 |
PR Code Suggestions ✨Latest suggestions up to 31f8a2a Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit b9c4c8a
Suggestions up to commit 60e3690
|
Signed-off-by: Eric Wei <menwe@amazon.com>
Persistent review updated to latest commit b9c4c8a |
| String.format( | ||
| "source=%s | eval arr = array(1, 2, 3), result = mvmap(arr, arr * age) | head 1 |" | ||
| + " fields age, result", | ||
| "source=%s | eval arr = array(1, 2, 3), result = mvmap(arr, arr * age) | sort" |
There was a problem hiding this comment.
I see most are caused by head and we fix by adding sort or where. Just thinking any way to enforce this in our IT?
There was a problem hiding this comment.
Good question. OpenSearch core handles this behaviorally rather than with a static rule. Its integration-test framework randomizes index shard counts from 1 to 10, and tests choose ordered or order-insensitive assertions based on the contract. A static head rule would flag valid deterministic cases and miss non-head sources of shard-order dependence, so I opened #5738 to track a route-independent multi-shard SQL CI lane: #5738
Q10 selected its single top row with sort on an aggregated double alone, so a tie would let head 1 pick either row. Sort on c_custkey as well to pin the selected row on any shard layout. Signed-off-by: Eric Wei <menwe@amazon.com>
A JSONArray or JSONObject on only one side fell through to a toString comparison, so a container whose serialized form equalled a scalar string matched incorrectly. Reject that case and cover it with tests. Signed-off-by: Eric Wei <menwe@amazon.com>
Persistent review updated to latest commit 31f8a2a |
Summary
A set of integration tests selected rows through
head,limit, shard-local representative choice, or unordered collection output, then asserted exact single-shard results.This change selects intended fixture rows with unique keys, compares unordered collections as multisets, and uses numeric tolerances only for distributed floating-point or geo-point encoding differences. Schema, cardinality, grouping, source-value, and command-specific assertions remain exact.
No production behavior is modified.
Validation
spotlessCheck,compileTestJava, andgit diff --checkpass