Repository navigation
ci: right-size the anvil-e2e timeout budgets - #1657
Conversation
Anchor the anvil-e2e timeouts to measurement instead of to each other, and fix the containment defect where per-test ceilings sat below the retry ladders they were supposed to contain (#1620). Per-test ceilings (crates/e2e/src/timeout.rs): replace the 300/600/780/1200s spread with two measurement-anchored tiers — STANDARD 300s and HEAVY 600s — and put the tier-selection rule in the constant's doc so the next journey inherits it rather than copying a number. HEAVY is reserved for journeys whose internal poll ladder exceeds ~150s (g_gov_02, origin_blacklist_compliance, slash_appeal, the g_node_07 eth leg). Hoist forge build (.github/workflows/ci.yml): the cold contract compile now runs once per job, outside any per-test ceiling; each fixture's in-test forge build becomes a warm incremental no-op. This removes the ~30m CI worst-case cold build from every test at once. Deploy ladder (crates/e2e/src/chain.rs): DEPLOY_ATTEMPTS 4 -> 2. The deploy ladder runs inside every fixture and cannot be hoisted (it needs the test's own anvil), so it is the binding in-test ladder the ceilings must contain. Two attempts cap the CI worst case at 2 * ci_scaled(60s) = 240s, contained by the 300s standard tier, while keeping one snapshot-reverted retry at the full per-attempt margin — the #1384 starvation fix is per-attempt time, not attempt count, so it stays intact. Job bounds derived from observed duration, not a sum of ceilings: journeys 200m -> 30m (~3.5x the worst observed run), settlement 60m -> 20m (floored by the settlement test's own 13m in-test ceiling + compile per the #785 ordering, which is why 20m rather than the issue's suggested 15m). Item 5: cap the corrupt-outboard test's two expected-failure fetches at a 20s retry budget (new ClientFixture::fetch_with_deadline) instead of the 45s default — safe because a shorter budget on a fetch that must fail can only surface the failure sooner. cli_publish's 60s poll is left as-is: it is watcher-convergence bound and the poll already returns early, so cutting the cap gains nothing and risks flakiness. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Gas snapshotNo gas changes vs base. |
Contracts coverageLine coverage: 90.07% (2629/2919 lines) |
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (21)
WalkthroughThe e2e crate now provides shared timeout tiers and configurable fetch deadlines. Deployment retries are limited to two attempts. CI runs hoisted contract builds and uses shorter job timeouts. E2E tests adopt the shared timeout tiers. ChangesE2E timeout and CI execution
Estimated code review effort: 3 (Moderate) | ~25 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
This PR right-sizes the anvil-e2e timeout model by moving from per-test bespoke ceilings and sum-of-ceilings job bounds to two shared, measurement-anchored tiers, while also hoisting expensive contract compilation out of per-test execution to reduce flakiness and wasted CI wall-clock.
Changes:
- Introduces shared journey timeout tiers (
STANDARD/HEAVY) and updates all anvil-e2e journeys to reference them. - Hoists
forge buildinto one-time job steps for the anvil-e2e GitHub Actions jobs and reduces job-leveltimeout-minutesbased on observed runtimes. - Lowers the deploy retry ladder attempt count and adds a caller-chosen retry budget API for negative fetch tests to reduce expected-failure runtime.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/e2e/tests/smoke.rs | Switches overall test ceiling to the shared STANDARD tier. |
| crates/e2e/tests/slash_appeal.rs | Moves to the shared HEAVY tier with rationale tied to poll ladder length. |
| crates/e2e/tests/origin_stream_while_store.rs | Uses STANDARD tier and tightens expected-failure fetch retry budget via new client API. |
| crates/e2e/tests/origin_blacklist_compliance.rs | Moves to the shared HEAVY tier based on repeated long catch-up polls. |
| crates/e2e/tests/g_origin_01_publish.rs | Uses shared STANDARD tier for the journey ceiling. |
| crates/e2e/tests/g_node_07_rotate_key.rs | Uses STANDARD for base journey and HEAVY for the sequential CLI Ethereum leg. |
| crates/e2e/tests/g_node_06_unbond.rs | Switches to shared STANDARD tier for overall ceiling. |
| crates/e2e/tests/g_node_04_blacklist_compliance.rs | Switches to shared STANDARD tier with tier-selection rationale. |
| crates/e2e/tests/g_gov_03_real_evidence.rs | Switches to shared STANDARD tier with time-warp justification. |
| crates/e2e/tests/g_gov_02_rate_bounds.rs | Switches to shared HEAVY tier due to long sequential poll ladder. |
| crates/e2e/tests/coop_close_watermark_reconcile.rs | Switches overall ceiling to shared STANDARD tier. |
| crates/e2e/tests/cli_setup_partial.rs | Switches overall ceiling to shared STANDARD tier. |
| crates/e2e/tests/cli_publish.rs | Switches overall ceiling to shared STANDARD tier. |
| crates/e2e/tests/cli_fetch_topup.rs | Switches overall ceiling to shared STANDARD tier. |
| crates/e2e/tests/cli_fetch_resume.rs | Switches overall ceiling to shared STANDARD tier. |
| crates/e2e/tests/cli_bundle_pull_channel_id.rs | Switches overall ceiling to shared STANDARD tier. |
| crates/e2e/src/timeout.rs | Adds the new shared timeout tiers and documents the tier-picking rule and measurement basis. |
| crates/e2e/src/lib.rs | Exposes the new timeout module. |
| crates/e2e/src/client.rs | Adds ClientFixture::fetch_with_deadline for caller-chosen readiness retry budgets. |
| crates/e2e/src/chain.rs | Reduces DEPLOY_ATTEMPTS and updates commentary around build/deploy ladders and CI containment. |
| .github/workflows/ci.yml | Hoists forge build into job steps and reduces job timeout-minutes based on observed runtimes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| //! The binding ladder is the deploy retry ladder in [`crate::chain`]: CI worst | ||
| //! case `DEPLOY_ATTEMPTS * ci_scaled(DEPLOY_TIMEOUT)` = `2 * 120s = 240s`, so | ||
| //! every tier here clears 240s. `forge build` no longer counts toward it — it is | ||
| //! hoisted to a one-time job step (`.github/workflows/ci.yml`), so the cold | ||
| //! contract compile happens once, outside any per-test ceiling, and the in-test | ||
| //! `forge build` is a warm incremental no-op under CI. |
There was a problem hiding this comment.
Good catch — fixed in e38e3d1. The module doc now says explicitly that forge build drops out of the binding in-test ladder only under CI (the hoisted step) and warm-artifact local runs; a cold local run still pays the build ladder inside a per-test ceiling, which is acceptable because a local run has no job-level kill racing the per-test message (the containment guarantee is a CI property).
| /// the assertion wants. Such a caller passes a budget tighter than the 45s | ||
| /// [`Self::fetch`] default to keep its runtime bounded. That is strictly safe: | ||
| /// a shorter budget can only surface the expected failure sooner, never turn a | ||
| /// real success into a spurious timeout. It must still clear the node's | ||
| /// ~500ms-cadence watcher catch-up so the failure reflects the refusal under | ||
| /// test, not an un-observed channel. |
There was a problem hiding this comment.
Agreed — fixed in e38e3d1. The doc now scopes the "shorter budget never causes a spurious timeout" property to expect-failure callers, and adds that a positive fetch can expire in the channel-open→watcher-observe window and must keep headroom above the ~500ms catch-up (which is why fetch budgets a generous 45s).
…afety Address review feedback on #1657: - timeout.rs: make explicit that `forge build` drops out of the binding in-test ladder only under CI (hoisted step) and warm-artifact local runs; a cold local run still pays the build ladder inside a per-test ceiling, which is fine because local runs have no job-level kill racing the message. - client.rs: scope the "shorter budget never causes a spurious timeout" property of fetch_with_deadline to expect-failure callers; note that a positive fetch needs headroom above the watcher catch-up window. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Coverage reportTotal: 80.45% (was 80.47%, ▼ 0.02%) — 62442/77620 lines
History
|
Closes #1620.
Anchors the anvil-e2e timeouts to measurement instead of to each other, and fixes the containment defect (issue part 2) where per-test ceilings sat below the retry ladders they were meant to contain.
What changed
Per-test ceilings → two measurement-anchored tiers (
crates/e2e/src/timeout.rs, new). Replaces the300/600/780/1200sspread withSTANDARD = 300sandHEAVY = 600s. The rule for picking a tier lives in the constant's doc, so the next journey inherits reasoning instead of copying a number. Every test'sOVERALL_TIMEOUTnow references a shared tier.HEAVYis reserved for journeys whose internal poll ladder exceeds ~150s:g_gov_02(120+60+120+60s),origin_blacklist_compliance(repeated 180s catch-up polls),slash_appeal(120+30+30s), and theg_node_07eth leg (five sequential CLI invocations).Hoist
forge buildinto a one-time job step (.github/workflows/ci.yml, both anvil jobs). The cold contract compile now runs once per job, outside any per-test ceiling; each fixture's in-testforge buildbecomes a warm incremental no-op. This removes the ~30m CI worst-case cold build from every test.cache-profile: noneis kept — enabling thecicache would need the fixtures on that same forge profile to avoid recompiles, noted as a follow-up.Deploy ladder
DEPLOY_ATTEMPTS4 → 2 (crates/e2e/src/chain.rs). The deploy ladder runs inside every fixture and can't be hoisted (it needs the test's own anvil), so it's the binding in-test ladder the ceilings must contain. Two attempts cap the CI worst case at2 × ci_scaled(60s) = 240s, contained by the 300s standard tier, while keeping one snapshot-reverted retry at the full per-attempt margin — the #1384 starvation fix is per-attempt time, not attempt count, so it stays intact.Job bounds from observed duration, not a sum of ceilings. journeys
200m → 30m(~3.5× the worst observed run, covering the compile the job also runs). settlement60m → 20m.Item 5. The corrupt-outboard test's two expected-failure fetches now use a 20s retry budget (new
ClientFixture::fetch_with_deadline) instead of the 45s default — strictly safe, since a shorter budget on a fetch that must fail can only surface the failure sooner.Decisions worth your eye
OVERALL_TIMEOUT(13m), so Flaky anvil-e2e:forge scriptdeploy subprocess hangs unbounded, freezing the test for minutes #785 requires the job bound to clear 13m + the pre-test compile + hoistedforge build. 15m leaves too little for that; 20m clears it and is still ~10× the 2m observed run. If you'd rather hit 15m, the settlement test's 13m ceiling would need retiering too — say the word.wait_for_metricreturns as soon as the origin-directory watcher converges, so the 60s is a generous cap the poll exits early from — its runtime is watcher-convergence bound, not the deadline. Cutting the cap gains nothing and risks flakiness. Documented rather than changed.Verification
cargo test --no-run -p decdn-e2e --features anvil-e2e— all 16 test targets compile.cargo clippy -p decdn-e2e --features anvil-e2e --tests— clean.cargo fmt -- --check— clean.ci.ymlYAML validates.🤖 Generated with Claude Code
Summary by CodeRabbit
Testing
CI