Skip to content

Distribute serial coverage tests across eight file shards - #814

Merged
fcostaoliveira merged 1 commit into
masterfrom
codex/fix-coverage-shard-balance-20261023
Oct 23, 2026
Merged

fcostaoliveira merged 1 commit into
masterfrom
codex/fix-coverage-shard-balance-20261023

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Coverage shard 2/4 timed out after 20 minutes while continuing to run tests in PR #807. The other three test steps finished in 335–656 seconds. Equal file counts have accumulated very unequal runtime. See #813 for job timestamps and attribution.

Root cause

Sorted filenames are assigned modulo the shard count. One four-way shard contains reconnect, retry, cluster redirects and simple-flow modules together. Adding another test file shifts subsequent assignments; the 20-minute capacity cannot reliably absorb the heavy grouping.

Fix

Use eight file shards, updating the matrix/check names, exact-once discovery check, selector count and required report list together. Keep the existing selector, serial tests and separate gcda files, 20-minute test limit, all-shards-success gate, full report merge and unit coverage once on shard 1. This adds four runner builds; no tests or coverage are removed.

Tests

  • Current-tree real RLTest discovery assigns all 817 tests exactly once across eight nonempty shards.
  • The actual workflow merge shell successfully merges eight synthetic tracefiles with real lcov and preserves all eight source records. Removing any one of the eight files fails before producing coverage.info (8/8 negative controls).
  • Actionlint and git diff whitespace checks pass.
  • Observed four-shard test-step durations were 656/1212(timeout)/360/335 seconds. Approximate file spans repartition to a maximum 631 seconds with eight; a modeled additional 60-second file at every insertion position has a worst estimate 679 seconds. These estimates are not measured eight-shard CI timings; RLTest log buffering and the unfinished last module limit their precision. Actual current-head CI run 39971851992 now passes all eight coverage shards and aggregation: test steps take 200/383/413/169/335/529/405/130 seconds, with a maximum 529 seconds against the 1,200-second limit. An independent audit of all eight downloaded tracefiles and the merged artifact confirms the exact union of 99 sources, 14,365 line records and 1,485 function records, with every merged hit count equal to the sum across shards. This is measured completion for this head, not a guarantee against future suite growth.

Affected versions

CI only, unreleased master since 4bade818c3642e1771a34e2faddb3fcc9b96c956 (#792). No release tag contains that commit. Production binaries are unchanged. Related #679/#683 address earlier standalone capacity and #643 addresses coverage tooling.

Fixes #813

🤖 Generated with Claude Code


Note

Low Risk
CI-only workflow tuning; no application, test, or coverage logic changes beyond shard count.

Overview
CI coverage sharding is doubled from four to eight parallel jobs so serial RLTest file shards stay under the 20-minute timeout when modulo assignment piles slow modules into one shard.

Updates in .github/workflows/ci.yml include the matrix (shard: 1–8), job display name (/8), check_test_shards.py and select_test_shard.py arguments, and the merge step’s required shard report list. Unit tests on shard 1, per-shard gcda capture, and full lcov merge behavior are unchanged—only runner parallelism increases.

Reviewed by Cursor Bugbot for commit 884bf43. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coverage file-shard imbalance exhausts the test-step timeout

1 participant