Repository navigation
Description
The anvil-e2e timeout budgets are unanchored: every figure in the anvil-e2e-journeys justification comment is derived from other figures in it, none from a measurement. Two things follow, and the second is a real defect rather than waste.
Raised while landing #1614 (which pushed the job bound to 200m by faithfully applying the comment's stated rule). Analysis also posted on that PR and on #1034.
1. The job bounds are ~25x the observed run
anvil e2e (journeys) on main, four consecutive runs (2026-08-05): 5m23s, 5m40s, 6m00s, 8m37s — against timeout-minutes: 200.
anvil e2e (settlement): 2m02s against timeout-minutes: 60.
Full suite locally at --test-threads 1: 377s for all 36 tests. Only two exceed 25s:
| test | measured | its ceiling |
|---|---|---|
origin_stream_while_store::…rejects_a_corrupt_outboard… |
94.4s | 300s |
cli_publish::publish_namespace_and_assign_land_on_chain |
72.3s | 780s |
g_node_06_unbond::… |
22.7s | 780s |
g_gov_02_rate_bounds::… |
11.1s | 1200s |
slash_appeal::slash_detection_appeal_and_grant |
10.2s | 1200s |
The rest are ≤ 16s. The 1200s tier runs ~110x faster than its ceiling.
2. The per-test ceilings are smaller than the retry ladders they contain
This is the part worth fixing regardless of the wall-clock waste.
ci_scaled doubles the fixture budgets under CI (crates/e2e/src/chain.rs:95, CI_TIMEOUT_MULTIPLIER = 2). Worst-case setup inside a single test:
forge build—FORGE_BUILD_TIMEOUT300s x 2 xBUILD_ATTEMPTS3 = 1800sDeployProtocol—DEPLOY_TIMEOUT60s x 2 xDEPLOY_ATTEMPTS4 = 480s
~38m of setup inside a test whose largest OVERALL_TIMEOUT is 20m. Two consequences:
- The ladders are partly unreachable. A test that hits them trips its own
OVERALL_TIMEOUTfirst and reports as a generic timeout rather than as the deploy flake it is. flaky(ci): anvil-e2e DeployProtocol stalls under --test-threads 2 contention #1384 is exactly that flake, and its diagnosis cost three repeat runs of the same commit to pin down. origin_stream_while_storecarries a 300s ceiling — half of a single CI-scaled forge-build attempt. The journeys job setscache-profile: noneprecisely because "the fixtures drive their ownforge build", so that cold build runs inside whichever test nextest schedules first, on every run. Today that happens to becli_bundle_pull_channel_id(780s ceiling), so it passes. Test ordering is not a contract.
How it got here
Each fix raised one retry budget in isolation; the per-test ceilings never moved, and nobody re-checked containment.
- e2e: forge build is not retried and capped at 180s (cold-CI flake risk) #1066 added the
forge buildretry ladder, explicitly reasoning about "a possible cold-start flake within the 780s overall smoke budget" — containment was checked once, against a budget since outgrown. - flaky(ci): anvil-e2e DeployProtocol stalls under --test-threads 2 contention #1384 raised
DEPLOY_TIMEOUTand added the CI multiplier for--test-threads 2contention. - Flaky anvil-e2e:
forge scriptdeploy subprocess hangs unbounded, freezing the test for minutes #785 bounded the hangingforge scriptsubprocess, and is the origin of the "clear per-test message before the opaque job-level kill" ordering the comment defends. That ordering is sound; it just requires the per-test ceiling to actually be reachable first.
Proposal
- Anchor per-test ceilings to measurement, not to each other. Two tiers from observed p100 with a CI margin — roughly 180s and 300s — replacing today's 300/600/780/1200s spread. Put the rule in the constant's doc so the next journey inherits it instead of copying a number.
- Hoist
forge buildinto a job step that runs once. Fixtures sharecontracts/out, so only the first test pays a cold build anyway; this removes the 1800s worst case from every test at once and letscache-profile: nonebe revisited. Items 1 and 2 must land together — cutting a ceiling below the ladder it contains just inverts the bug. - Derive the job bound from observed job duration, not from a sum of per-test ceilings. That model assumes every test simultaneously burns its full budget, which cannot happen. Target
timeout-minutes: 30for journeys: ~3.5x the worst observed run, with room for the compile the job must also cover (that compile, not the tests, is what the 8m37s outlier reflects). - Same rule for
anvil-e2e-settlement: ~15m against a 2m02s run. - Optional. The only two tests above 25s:
cli_publishhas a hardcoded 60s poll deadline (crates/e2e/tests/cli_publish.rs:318) that dominates its runtime; the corrupt-outboard test's 94s is spent waiting out a real pull deadline rather than an explicit sleep.
Constraint to respect
The runner is a 4-vCPU box at --test-threads 2, so two anvils and two forge deploys contend — the condition #1384 documents. Margins have to survive that, which is the argument against cutting per-test ceilings to bare multiples of a local single-threaded measurement.
Note on the comment block itself
Its own history records going stale four times (#1574 was the third). #1574's suggested fix — script the sum at CI time and fail if the derived bound exceeds timeout-minutes — would automate the formula this issue argues is wrong. Prefer replacing the derived-arithmetic table with a stated rule plus a measurement date.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix(cli): close the review findings on decdn node rotate-key (#1614)
feat(cli): add `decdn node rotate-key` + G-NODE-07 journey (#1034) (#…
ci: right-size the anvil-e2e timeout budgets (#1657)