Skip to content

ci: right-size the anvil-e2e timeout budgets (200m bound vs ~6m runs; per-test ceilings smaller than their retry ladders) #1620

Closed

Description

@yigitdot

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_TIMEOUT 300s x 2 x BUILD_ATTEMPTS 3 = 1800s
  • DeployProtocol — DEPLOY_TIMEOUT 60s x 2 x DEPLOY_ATTEMPTS 4 = 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_TIMEOUT first 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_store carries a 300s ceiling — half of a single CI-scaled forge-build attempt. The journeys job sets cache-profile: none precisely because "the fixtures drive their own forge build", so that cold build runs inside whichever test nextest schedules first, on every run. Today that happens to be cli_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.

Proposal

  1. 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.
  2. Hoist forge build into a job step that runs once. Fixtures share contracts/out, so only the first test pays a cold build anyway; this removes the 1800s worst case from every test at once and lets cache-profile: none be revisited. Items 1 and 2 must land together — cutting a ceiling below the ladder it contains just inverts the bug.
  3. 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: 30 for 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).
  4. Same rule for anvil-e2e-settlement: ~15m against a 2m02s run.
  5. Optional. The only two tests above 25s: cli_publish has 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.

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

Metadata

Metadata

Assignees

Labels

github_actionskind:testprio:medium

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions