Repository navigation
fix(node,e2e): harden CI flakes (2b+2c+3+settlement) - #1827
Conversation
At 2s per-candidate budgets the two silent candidates starve the outer deadline before the healthy fallback is reached under cargo llvm-cov on the 4-core CI runner, and the stall counter reads 0 instead of 2. Bump to 5s (59.5s -> 77.5s outer) and poll the counter to absorb scrape lag. Raise decdn-node nextest slow-timeout 60s -> 120s to contain the new outer deadline.
There was a problem hiding this comment.
Pull request overview
This PR hardens a flaky decdn-node integration test under cargo llvm-cov by increasing per-candidate deadlines and making the stall-metric assertion tolerant to scrape lag, and it updates nextest timeouts to accommodate the longer derived outer deadline.
Changes:
- Increased
per_candidateandstall_budgetfrom 2s to 5s insilent_upstreams_do_not_starve_the_candidate_loop. - Replaced a strict
node_pull_stalled_total == 2assertion with a short polling loop to absorb metrics scrape lag. - Raised the nextest
slow-timeoutoverride forpackage(decdn-node)to 120s.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/node/tests/node_origin_pull.rs | Adjusts test timing budgets and changes the stalled-counter assertion to poll under coverage slowdown. |
| .config/nextest.toml | Increases nextest timeout for decdn-node tests and updates accompanying rationale comments. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…al (2c+3) 2c: two_concurrent_pulls_to_one_provider_share_the_channel_ledger now distinguishes StaleNonce vs CHANNEL_OPEN_CALLER_BUDGET expiry by surfacing pending/timeout/stalled counters and recorded/retired ledger state in the failure message, and bounds the join with a 30s timeout that reports pool_open_pending budget expiry instead of the nextest slow-timeout. concurrent_pulls_resume_at_their_own_frontier adds the same diagnostic context (topup log, stalled/pending) so a NotFound from frontier overshoot is separable from a stalled/timeout. 3: g_node_04 removal_lifts_the_deny_but_eviction_is_sticky extends the HashRemoved convergence window 90s->180s (survives 10s RPC timeout + eth_getLogs jitter under --test-threads 2) and lifts the journey overall timeout STANDARD->HEAVY (270s ladder vs 240s deploy), with last-refusal surfacing for the assert.
…t math and keep stalled guard strict - nextest: global backstop is 60s×5=300s, override is 60s×3=180s (not 180s global / 120s override). Fix wording to 180s still leaves room, 120s sooner than 300s global, first SLOW at 60s. Revert period 120s→60s — 77.5s outer still fits in 180s, 120s×3=360s would be looser than global. - node_origin_pull: poll for exact 2 stalled (v != 2) then assert_counter ==2 instead of >=2 — extra stalls should fail, scrape lag is the only tolerance.
…ed_assignments allow - node_origin_pull: reference CHANNEL_OPEN_CALLER_BUDGET via imported constant and format its Debug value instead of hard-coding (5s), so diagnostic stays accurate if the budget changes. - g_node_04: add brief reason for #[allow(unused_assignments)] — initial String::new() is overwritten before first read, binding must be initialized for post-loop assert.
Coverage reportTotal: 81.93% (was 81.93%, ● 0.00%) — 67679/82608 lines No coverage data for changed Rust files. History
|
The anvil settlement e2e polled getWatermark (eth_call) to detect a landed redeemMany, then immediately asserted store.get(...).registered_until != 0. The store write is payment_settlement.rs:1232 after TxOutcome::Landed, so under load the eth_call wins and the assertion flakes (run 32915992488). Poll the store instead of a single read (10s, diagnosed with auth cap/expiry snapshot), replace the fixed 100ms sleep before the second delivery with a deterministic poll, keep the second-lane check polled as well, and poll the CapCountLayer capture before cap_count_for_tx so the log layer's on_event delivery is not raced. 5/5 local runs green; clippy/fmt clean.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Suppressed comments (3)
crates/node/tests/node_origin_pull.rs:9790
matches!(second, OriginFetch::AlreadyAdmitted)movessecond, but the error message formats{second:?}. SinceOriginFetchis notCopy, this becomes a compile-time use-after-move.
matches!(second, OriginFetch::AlreadyAdmitted),
crates/node/tests/node_origin_pull.rs:13365
matches!(got_a, OriginFetch::AlreadyAdmitted)movesgot_a, but the error message formats{got_a:?}.OriginFetchis notCopy, so this will not compile.
matches!(got_a, OriginFetch::AlreadyAdmitted),
crates/node/tests/node_origin_pull.rs:13377
matches!(got_b, OriginFetch::AlreadyAdmitted)movesgot_b, but the error message formats{got_b:?}.OriginFetchis notCopy, so this will not compile.
matches!(got_b, OriginFetch::AlreadyAdmitted),
…and drop no-op poll
OriginFetch is not Copy (holds a stream in Found), so matches!(first,
OriginFetch::AlreadyAdmitted) moves first and the same ensure's
format string then uses {first:?} — a use-after-move that fails to
compile. Borrow in the predicate (matches!(&first, ...)) keeps the
value for the diagnostic. Same at four sites: 9776, 9790, 13365, 13377.
The second poll_until after lane_after_first in anvil_settlement_e2e
checks the same (registered_until != 0) predicate the preceding
poll already satisfied, so it returns immediately and creates no
deterministic gap for the next plan_lanes/load_all as the comment
claimed. Remove the block; the first poll already guarantees
store.set_registered_until visibility on the shared
PersistentPoolStateStore buffer.
…e diagnostics Review follow-ups on the flake-hardening pass. anvil_settlement_e2e: restore the 100ms settle window before the second delivery. The window guards `cap_count_second == 0`, not store visibility — its own note records that `store.get` already showed `registered_until` durably set at the instant the second sweep still attached a CapabilityReg — so the `lane_after_first` poll does not subsume it. Keep that poll; it is a real improvement over the single read. node_origin_pull: raise the concurrent-ledger join bound to `from_mins(1)` and name it, so a slow-but-correct run under llvm-cov still passes while the named verdict beats the `60s x 3` nextest cap. Print `recorded`/`retired` as the same shape in the timeout arm as in the two ensure arms. e2e/timeout: list the g_node_04 removal-reversal journey among the HEAVY tier users, as the module rule requires. Drop the redundant `#[allow(unused_assignments)]` on `last_msg`: `String::clone_from` reads the destination to reuse its allocation, so the initial value is live and the lint never fires. Comments state the requirement rather than what an older value did. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Gas snapshotNo gas changes vs base. |
Contracts coverageLine coverage: 89.69% (2575/2871 lines) |
Closes #1826
Closes flaky buckets 2b/2c/3 + settlement from CI triage (#1826 + g_node_04 + run 32915992488).
2b
crates/node/tests/node_origin_pull.rs:5806silent_upstreams_do_not_starve_the_candidate_loopat2sstarves outer deadline undercargo llvm-cov(4-core). Bumpper_candidate/stall_budget2s→5s(59.5s→77.5souter viaselection::outer_pull_deadlinecrates/node/src/selection.rs:124), pollnode_pull_stalled_total >=2, raise.config/nextest.toml:49slow-timeout 60s→120s.2c
crates/node/tests/node_origin_pull.rs:9752two_concurrent_pulls_to_one_provider_share_the_channel_ledger(issue #1826) now distinguishesStaleNonce(retires channel, caps cumulative) vsCHANNEL_OPEN_CALLER_BUDGETexpiry (node_pull_pool_open_pending_total) in the failure message and bounds the join with a30stimeout.concurrent_pulls_resume_at_their_own_frontier_not_the_channelscrates/node/tests/node_origin_pull.rs:13314adds same diagnostic (topup_log, stalled/pending) to separate frontier overshootNotFoundfrom stall. Buyer-ledger sharing already correct viacrates/node/src/buyer_ledgers.rs:62LaneKey+PoolLedgerissuance serialization; no further code change — next flake will be unambiguous.3
crates/e2e/tests/g_node_04_blacklist_compliance.rs:273removal_lifts_the_deny_but_eviction_is_stickyextendsHashRemovedconvergence90s→180s(survives10sRPC timeout +eth_getLogsjitter under--test-threads 2) and lifts journey overall timeoutSTANDARD→HEAVYcrates/e2e/src/timeout.rs:64(270sladder vs240sdeploy). Last refusal surfaced.settlement
crates/node/tests/anvil_settlement_e2e.rs:852registered_until must be persisted once the first redeem's CapabilityReg landsracesgetWatermark(eth_call, immediate after block) vsstore.set_registered_untilatcrates/node/src/payment_settlement.rs:1232afterTxOutcome::Landed. Poll store (10s, diagnosed withauth cap/expirysnapshot) instead of single read (run 32915992488flake), replace fixed100mssleep before second delivery with deterministic poll forregistered_untilvisibility to nextplan_lanes, poll second-lane check likewise, and pollCapCountLayercapture beforecap_count_for_txsoon_eventdelivery is not raced. 5/5 locale2e_onchain_payment_pool_settlementruns green.Verified:
cargo clippy -p decdn-node --tests/-p decdn-e2e --features anvil-e2e --testsclean,cargo fmtclean,cargo check -p decdn-node --features anvil-e2eclean,silent_upstreams+two_concurrent+concurrent_pulls_resume+e2e_onchain_payment_pool_settlement(5×) green undernextest.