test(integ-test): stabilize stream-order commands across shards - #5729
test(integ-test): stabilize stream-order commands across shards#5729mengweieric wants to merge 3 commits into
Conversation
Use deterministic streams for exact order-sensitive semantics and membership/cardinality assertions for representative selection. Preserve real multi-shard property coverage without changing production behavior. Signed-off-by: Eric Wei <menwe@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit bbe59ba)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to bbe59ba
Previous suggestionsSuggestions up to commit edc0d81
|
| universe.put( | ||
| "BLOCK* NameSystem.addStoredBlock: blockMap updated: <*IP*> is added to blk_<*> size <*>", | ||
| Arrays.asList( | ||
| "BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.31.85:50010 is added to" | ||
| + " blk_-7017553867379051457 size 67108864", | ||
| "BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.107.19:50010 is added to" | ||
| + " blk_-3249711809227781266 size 67108864")); |
There was a problem hiding this comment.
The test set not human readable. 2 ideas
- change take(content, 1) to min/max.
- add containsInAnyOrder
There was a problem hiding this comment.
Updated this to use max(content), which makes the sample deterministic across shards. verifyDataRows already performs an order insensitive comparison.
| List<List<Object>> rows = dataRows(actual); | ||
| assertEquals(9, rows.size()); | ||
| Set<Object> nonNullNames = new HashSet<>(); | ||
| Set<List<Object>> nullNameRows = new HashSet<>(); | ||
| for (List<Object> row : rows) { | ||
| Object name = row.get(0); | ||
| Object category = row.get(1); | ||
| if (name == null) { | ||
| nullNameRows.add(Arrays.asList(name, category)); | ||
| } else { | ||
| nonNullNames.add(name); | ||
| assertValidPair(name, category); | ||
| } | ||
| } |
There was a problem hiding this comment.
Yes. I added sort name, category before dedup and replaced the permissive valid pair check with exact expected rows.
Signed-off-by: Eric Wei <menwe@amazon.com>
Address review feedback on the multi-shard stream-order stabilization: use max(content) for the dashboard patterns sample and assert exact rows; sort name, category before dedup KEEPEMPTY to pin exact survivors; add seq-augmented and single-shard fixtures so streamstats/reverse/dedup encounter order is deterministic across shard layouts; assertNotNull on the server lookup. Test-only; no production behavior change. Signed-off-by: Eric Wei <menwe@amazon.com>
|
Persistent review updated to latest commit bbe59ba |
Summary
Several Streamstats, Reverse, Dedup, and Patterns tests relied on the incidental encounter order of a single-shard index. On multiple shards, the commands returned valid results for a different stream order and the tests asserted different row content.
This change uses deterministic
makeresultsstreams where exact order is part of the test, and membership/cardinality assertions where representative selection is not defined. Real multi-shard index coverage remains through order-independent property checks. Tests that require nullable numeric streams or expose known engine gaps are intentionally unchanged.No production behavior is modified.
Validation
spotlessCheck,compileTestJava, andgit diff --checkpass