Skip to content

Commit fc00cd6

Browse files
authored
ci: rebalance the e2e and shreds-e2e shard matrices (#4249)
## Summary - The e2e matrix runs 5 round-robin shards instead of 4. Shards are filled round-robin by test *count*, not by duration, so which shard gets the slow tests is luck. The heaviest shard was carrying ~3735s of tests against a 15-minute job timeout and was cancelled partway through, while the lightest carried 2840s. A fifth shard brings the worst case back to ~3022s. - shreds-e2e pins one heavy test to its own shard instead of three. `TestE2E_MultiUserInstantAllocationAndWithdrawal` and `TestE2E_DeviceScale` no longer exist in doublezero-shreds, so the pin validation failed on every run and the matrix was never built — the workflow has been red on main since 05fb0ab. Only `TestE2E_FeedSubscriptionOracleExpiryTeardown` stays pinned, leaving 1 pinned + 2 round-robin shards. - `CHECK_SHARDS` follows the matrix in both workflows, so the docs-only skip path reports exactly the contexts the matrix creates. ## Required ruleset changes `CHECK_SHARDS` must match the required status check contexts in the main ruleset, so merging this needs two manual admin steps: - **add** `e2e (shard 6)` - **remove** `shard-e2e (shard 4)` and `shard-e2e (shard 5)` — until these are removed they are required but never reported, which blocks merges. ## Testing Verification - Measured total test-seconds per shard from CI logs to find the cliff. Shards at 3568s, 3735s and 3783s hit the 15-minute timeout; shards at 2840s, 3428s and 3507s passed. main itself was already running at 3012-3318s, leaving almost no headroom for any new test. - Verified the 6-shard e2e layout on a branch: work per shard landed at 2214-3022s and every shard finished in 5.5-9.4 minutes, against a 15-minute timeout. - Confirmed the shreds-e2e pin validation failure reproduces on main and that `TestE2E_FeedSubscriptionOracleExpiryTeardown` is present in the upstream discovery output.
1 parent 4a94441 commit fc00cd6

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ concurrency:
2828
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2929

3030
env:
31-
SHARD_COUNT: "4"
31+
SHARD_COUNT: "5"
3232
# Use registry-qualified image names so we can push/pull between jobs
3333
DZ_IMAGE_REPO: ghcr.io/malbeclabs/dz-e2e
3434
DZ_IMAGE_TAG: ${{ github.event.inputs.image_tag || github.sha }}
@@ -153,7 +153,7 @@ jobs:
153153
CHECK_NAME: e2e
154154
# SHARD_COUNT round-robin shards + 1 dedicated shard; must match the
155155
# required status check contexts in the main ruleset.
156-
CHECK_SHARDS: "5"
156+
CHECK_SHARDS: "6"
157157
with:
158158
script: |
159159
try {

.github/workflows/shreds-e2e.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ jobs:
5555
uses: actions/github-script@v7
5656
env:
5757
CHECK_NAME: shard-e2e
58-
# 3 pinned shards + 2 round-robin shards; must match the required
58+
# 1 pinned shard + 2 round-robin shards; must match the required
5959
# status check contexts in the main ruleset.
60-
CHECK_SHARDS: "5"
60+
CHECK_SHARDS: "3"
6161
with:
6262
script: |
6363
try {
@@ -192,28 +192,26 @@ jobs:
192192
echo "Discovered $count tests"
193193
echo "$tests"
194194
195-
# Pinned heavy tests: each gets its own shard slot to keep the
196-
# biggest rocks off the same runner. Update this list if a new test
197-
# exceeds ~5min, or if a pinned test is renamed/removed upstream
195+
# Pinned heavy test: it gets its own shard slot to keep the biggest
196+
# rock off a shared runner. Add to this list if a new test exceeds
197+
# ~5min, or update it if a pinned test is renamed/removed upstream
198198
# (the validation below will fail fast in that case).
199-
pinned_1="TestE2E_MultiUserInstantAllocationAndWithdrawal"
200-
pinned_2="TestE2E_DeviceScale"
201199
# ~9min, over half of it a single 40-day ledger warp (three validator
202200
# restart hops). On a round-robin shard it only passed when Go's
203201
# parallel scheduler happened to start it early.
204-
pinned_3="TestE2E_FeedSubscriptionOracleExpiryTeardown"
202+
pinned_1="TestE2E_FeedSubscriptionOracleExpiryTeardown"
205203
206204
# Fail fast if a pinned test no longer exists in the shreds repo —
207205
# otherwise its shard would silently run zero tests.
208-
for pin in "$pinned_1" "$pinned_2" "$pinned_3"; do
206+
for pin in "$pinned_1"; do
209207
if ! echo "$tests" | grep -qxF "$pin"; then
210208
echo "::error::Pinned test '$pin' not found in doublezero-shreds. Update the pin list in this workflow."
211209
exit 1
212210
fi
213211
done
214212
215-
# Remaining tests round-robin across shards 4 and 5.
216-
remaining=$(echo "$tests" | grep -vE "^(${pinned_1}|${pinned_2}|${pinned_3})$")
213+
# Remaining tests round-robin across shards 2 and 3.
214+
remaining=$(echo "$tests" | grep -vE "^(${pinned_1})$")
217215
218216
ROUND_ROBIN_SHARDS=2
219217
declare -a shards
@@ -229,12 +227,10 @@ jobs:
229227
i=$((i + 1))
230228
done <<< "$remaining"
231229
232-
# Build JSON matrix: shards 1-3 are pinned, shards 4-5 are round-robin.
230+
# Build JSON matrix: shard 1 is pinned, shards 2-3 are round-robin.
233231
matrix="[{\"shard\":1,\"run\":\"^(${pinned_1})$\"}"
234-
matrix="${matrix},{\"shard\":2,\"run\":\"^(${pinned_2})$\"}"
235-
matrix="${matrix},{\"shard\":3,\"run\":\"^(${pinned_3})$\"}"
236232
for ((i=0; i<ROUND_ROBIN_SHARDS; i++)); do
237-
matrix="${matrix},{\"shard\":$((i + 4)),\"run\":\"^(${shards[i]})$\"}"
233+
matrix="${matrix},{\"shard\":$((i + 2)),\"run\":\"^(${shards[i]})$\"}"
238234
done
239235
matrix="${matrix}]"
240236

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ All notable changes to this project will be documented in this file.
1212
- SDK
1313
- The TypeScript and Python `GlobalState` deserializers expose `ip_verifier_authority_pk`, the RFC-27 trust root the Go SDK and the Rust state already carried, so those consumers can read which key signs IP ownership proofs. The field is appended, so an account written before the upgrade decodes it as the default pubkey rather than failing. (#4231)
1414
- CI
15+
- The e2e matrix runs 5 round-robin shards instead of 4. Shards are filled by test count, not by duration, so the heaviest one was carrying ~3735s of tests against a 15-minute job timeout and was cancelled mid-run; the extra shard brings the worst case back to ~3022s. Adding `e2e (shard 6)` to the required status checks in the main ruleset is a separate, manual step.
16+
- shreds-e2e pins one heavy test to its own shard instead of three. `TestE2E_MultiUserInstantAllocationAndWithdrawal` and `TestE2E_DeviceScale` no longer exist in doublezero-shreds, so the pin validation failed every run and the matrix was never built. Only `TestE2E_FeedSubscriptionOracleExpiryTeardown` stays pinned, leaving 1 pinned + 2 round-robin shards. Dropping `shard-e2e (shard 4)` and `shard-e2e (shard 5)` from the required status checks in the main ruleset is a separate, manual step — until it happens those contexts are required but never reported.
1517
- `.cursor/BUGBOT.md` and `.github/copilot-instructions.md` now tell Bugbot and Copilot to read the nearest sibling, flag a path that skips a zero or a duplicate, and assert a specific error and the exact log line at the expected index. Onchain checks apply only when the repository has onchain code. The eight path-scoped files under `.github/instructions/` are removed so Copilot reads only the repo-wide file. (#4247)
1618
- E2E/QA
1719
- Remove `TestQA_MulticastSettlement`. It funded a seat through `doublezero-solana shreds pay`, which is going away. The agent seat-pay RPC now returns Unimplemented if something still calls it. Unused settlement helpers go with the test. (#4248)

0 commit comments

Comments
 (0)