Repository navigation
test(e2e,node): fix the two reproducible sources of CI flakiness - #1878
Merged
Merged
Conversation
`cli_fetch_delegated` asserted on a `PoolRedeemed` log through a filter that named no `fromBlock`. alloy omits the field when it is `None` and anvil then reads the range as `latest..latest`, so the assertion only held while the redemption sat in the head block and failed the moment anything mined after it. Anchor the scan at a block captured before the fetch and poll it, matching `anvil_settlement_e2e::redeem_tx_for_lane`. Proven differentially: with five empty blocks mined after the redemption, the old filter fails with the exact message CI reported and the new one passes. `node_origin_pull`'s `DEFAULT_TEST_PULL_DEADLINES` claimed to be generous enough that a loaded runner never trips it. It was not: a fixture costing 1.3s uncontended has ended on that 20s stall bound at 21.4s, on CI and in a local whole-package run. Size it to be unreachable instead; the nextest per-test cap remains the backstop for a genuine wedge. The four inline configs that duplicated the literal now reference the constant. The widening deliberately stays off the shared builder: two fixtures feed the same budgets to `selection::outer_pull_deadline` and assert on what it derives, so a margin applied behind the caller's back would put the config and that derivation out of step. Also scope nextest `retries` to the suites that drive live endpoints, anvil and forge, and claim two scheduler slots per `node_origin_pull` test so its 65 multi-thread tokio fixtures stop co-scheduling four-at-a-time on a four-core runner. Contention repro (4 cores, 4 spinners, retries off): was 2/6 failing, now 0/6. Workspace 3057/3057; the affected e2e journeys 4/4. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Mfyosg52pVuL5t2XLwx1Vu
There was a problem hiding this comment.
Pull request overview
This PR reduces CI flakiness in the Rust e2e and node test suites by fixing an anvil log-query bug in cli_fetch_delegated, expanding test pull deadline budgets to tolerate CPU-starved runners, and scoping nextest retries/slot requirements to the suites that legitimately contend on shared resources.
Changes:
- Fix
cli_fetch_delegated’sPoolRedeemedassertion by anchoring theeth_getLogsscan withfrom_blockand polling for log availability. - Increase
node_origin_pull’s default(pull_timeout, stall_timeout)budgets to values intended to be unreachable during honest progress on loaded CI runners, and reuse those defaults consistently in affected fixtures. - Update
.config/nextest.tomlto scoperetries = 2to anvil/iroh-heavy suites and to reducenode_origin_pulloversubscription viathreads-required = 2.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/node/tests/node_origin_pull.rs | Widen default pull/stall deadlines and align fixtures/comments with “unreachable budgets” intent under contention. |
| crates/e2e/tests/cli_fetch_delegated.rs | Make PoolRedeemed log assertion robust by bounding log scans with from_block and polling instead of one-shot reads. |
| .config/nextest.toml | Scope retries to flaky-by-contention suites and reduce concurrency pressure for node_origin_pull via slot requirements. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 82.27% (was 82.27%, ● 0.00%) — 69250/84173 lines No coverage data for changed Rust files. History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
~19% of concluded CI runs were failing (29 / 154). Investigating the failed jobs turned up two reproducible causes plus two things worth naming but not fixed here.
What
1.
cli_fetch_delegated— a real bug, 3 of the 6anvil e2e (journeys)failuresThe
PoolRedeemedassertion usedFilter::new().address(..).event_signature(..)with no block range. alloy omitsfromBlock/toBlockwhen they areNone, and anvil then reads the range aslatest..latest— the head block alone, not a full-history scan. The assertion therefore held only while the redemption happened to sit in the head block.Verified in isolation first (anvil, two log-emitting txs then one unrelated tx: the no-range query returns 0 logs,
fromBlock: 0x0returns 2), then differentially against the real journey:no PoolRedeemed event named the delegate signer …, the exact CI messagefrom_block+ poll)The correct sibling already exists at
crates/node/tests/anvil_settlement_e2e.rs:1214, whose doc comment names this hazard.2.
node_origin_pullwall-clock budgets — CPU starvationThe
testjob runscargo llvm-cov nextest --workspace(3038 tests) on a four-core runner with no--test-threadscap, while 297 workspace tests are#[tokio::test(flavor = "multi_thread")]withworker_threadsunpinned. The evidence is the blowup of the same tests:concurrent_pulls_resume_at_their_own_frontier_not_the_channelsstalled=1, 20s bound)two_concurrent_pulls_to_one_provider_share_the_channel_ledgerDEFAULT_TEST_PULL_DEADLINESis now sized to be unreachable rather than merely large. No test that uses it asserts on either bound firing; the.config/nextest.tomlper-test cap stays the backstop for a genuine wedge.3–4. nextest profile
retries = 2scoped to the suites that drive live endpoints, anvil and forge — never global, so everything else stays a first-attempt hard failure.threads-required = 2onbinary(node_origin_pull)halves its co-scheduling where slots are scarce and costs nothing on a developer box.Verification
--retries 0): was 2/6 failing → now 0/6, with the budget fix alone doing the work.decdn-nodepackage ×3, retries off: 1057/1057 each, and ~8s faster.cargo fmt --checkand clippy clean across both feature sets, checked by exit code.Not fixed here
two_concurrent_pulls_to_one_provider_share_the_channel_ledger(1 failure) is not explained by this. Its metrics werestalled=0 timeout=0 pending=0with two ledger recordings each at one pull's wire bytes — unshared ledgers, not a budget expiry — and it did not reproduce. Possibly a real race inBuyerLedgers. Retries will now surface it as FLAKY; that line is a defect signal to chase, not noise.sendmsg EINVALto an Azure IP) before a warm-upNotFound. n=1, unaddressed.error[E0053]reds on main were a semantic merge conflict, not flakiness, and are already resolved.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mfyosg52pVuL5t2XLwx1Vu