Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: shard the consensus suite four ways
Consensus Tests is 67% of this repo's CI compute and, at ~987s, the critical
path every PR waits on. It is now four shards of ~66 files each.

Modelled from the measured 987s: the slowest shard lands near 250s, so wall
clock drops to roughly 4-5 minutes and Rehearsal Drill Checks (~279s) becomes
the new critical path. Compute is close to flat -- four checkouts and four bun
installs replace one -- so this buys feedback time, not minutes. On a public
repo on hosted runners that is the right thing to optimise.

4 shards is conservative because the slowest single file sets the floor. Raise
it once real per-shard timings are visible; do not guess.

The two shell guards (launcher-wipe-guard, launcher-external-db) are not
partitioned and run in every shard. They are stubs, measured at ~2s, so
repeating them is cheaper than adding a mode flag to skip them.
  • Loading branch information
hackobi committed Nov 18, 2026
commit ad59e49dbecaff244a78dfaad66d090e13a28190
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,21 @@ jobs:
- run: bun run test:release

consensus-tests:
name: Consensus Tests
# 265 test files, one process each, run in series on a 2-vCPU runner: ~16
# minutes of latency-bound work and the single longest job in this repo.
# Sharding splits that across runners. The suite total is divided
# round-robin over the sorted file list, so every file lands in exactly one
# shard -- no duplicates, no gaps -- and the split is even to within one file.
#
# 4 shards is deliberately conservative: the slowest single file sets the
# floor, so more shards stop paying once a shard is down to a few files each.
# Raise this after looking at per-shard timings on a few real runs.
name: Consensus Tests (${{ matrix.shard }}/${{ strategy.job-total }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
Expand All @@ -36,7 +49,9 @@ jobs:
- run: bash scripts/launcher-wipe-guard.test.sh
# The PG_PORT the launcher hands the node, with and without -e
- run: bash scripts/launcher-external-db.test.sh
- run: bun run test:consensus
# Test files are partitioned; the two shell guards above are not, and are
# cheap enough that repeating them per shard is the honest trade.
- run: bash scripts/test-consensus.sh --shard ${{ matrix.shard }}/${{ strategy.job-total }}

rehearsal-drill:
# Unit tests for the quorum-loss drills' pass criteria and inputs, the
Expand Down Expand Up @@ -103,4 +118,4 @@ jobs:
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- run: bash native/tlsn-verify/build.sh check
- run: bash native/tlsn-verify/build.sh parity
- run: bash native/tlsn-verify/build.sh parity
Loading