ci: shard node_compat tests into 2 parallel jobs#33298
ci: shard node_compat tests into 2 parallel jobs#33298bartlomieju wants to merge 2 commits intomainfrom
Conversation
The node_compat CI job now takes ~20m. Split it into 2 shards per OS (6 total matrix entries) using the same round-robin distribution as specs/integration tests via CI_SHARD_INDEX/CI_SHARD_TOTAL env vars. Report uploads are suffixed with shard index, and the summary script merges shard reports when generating the daily summary (with fallback to the old unsharded filename for historical reports). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| if (shardReports.length === 1) { | ||
| return shardReports[0]; | ||
| } | ||
| // Merge shard reports: combine results, sum counts |
There was a problem hiding this comment.
Problem: the summary merge path blindly sums total/pass across shard reports while also overwriting duplicate results keys.
Why here: merged.results[key] = value will silently replace an existing entry if the same test id ever appears in multiple shard reports, but merged.total += shard.total / merged.pass += shard.pass still count both copies. That makes the metadata potentially inconsistent with the merged results object.
Impact: if sharding ever overlaps due to a bug, retry artifact mixup, or future shard-count changes, the monthly summary can overcount totals/passes while hiding the collision.
Ask: can we either assert that result keys are disjoint when merging shard reports, or recompute total/pass from the merged results object after merge? That would make the summary logic more robust to bad inputs.
Recompute total and pass counts from the merged results object after combining shard reports, rather than summing each shard's counts. This prevents inconsistency if shards ever overlap due to a bug or retry artifact mixup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
miracatbot
left a comment
There was a problem hiding this comment.
Re-checked after the update: recomputing total/pass from the merged result set fixes the inconsistency I had called out in the shard-summary merge logic. This looks good to me.
Summary
node_compatCI job into 2 shards per OS (3 OS x 2 shards = 6 matrix entries), halving wall-clock time from ~20m to ~10mCI_SHARD_INDEX/CI_SHARD_TOTALenv vars and round-robinfilter_to_shardmechanism already used by specs and integration testsreport-linux-0.json.gz,report-linux-1.json.gz)Test plan
cargo test --test node_compatpath🤖 Generated with Claude Code