test(integ-test): stabilize stream-order commands across shards - #5729
test(integ-test): stabilize stream-order commands across shards#5729mengweieric wants to merge 1 commit 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 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
| 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
| 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); | ||
| } | ||
| } |
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