Repository navigation
Description
Collected follow-ups from the review of #1832. Grouped into one issue rather than four; they are independent and can be closed in separate PRs.
1. wedged_source_is_ended_by_the_watchdog_and_its_tail_reassigned is load-flaky
crates/client-pull/src/scheduler.rs:2084. Passes solo (2.3s, 3/3), fails reproducibly when the crate runs alongside decdn-node:
cargo nextest run -p decdn-node -p decdn-client-pull --no-fail-fast
FAIL [ 1.6s ] ( 251/1282) decdn-client-pull scheduler::tests::wedged_source_is_ended_by_the_watchdog_and_its_tail_reassigned
Reproduced 2/2 on a clean origin/main worktree at 99a2e64, so this is not from #1832 — that PR does not touch scheduler.rs. Verified on 14-core darwin.
Diagnosis: the test races a wall-clock unit_deadline: Duration::from_millis(600) against a real 16 MiB delivery from a ScriptedSource. Under the CPU contention of a 1282-test parallel run the healthy lane misses that deadline and the watchdog ends the wrong source. CI is a 4-core runner under llvm-cov, a much harsher amplifier. The fixture drives real byte movement, so the fix is probably to raise/derive unit_deadline from a measured checkpoint cost rather than to pause the clock.
2. SHUTDOWN_TIMEOUT > ABANDON_DRAIN_CAP cannot be pinned in code
crates/node/tests/support/mod.rs derives SHUTDOWN_TIMEOUT (15s) as 1.5x node_origin::abandon_drain::ABANDON_DRAIN_CAP (10s), but only in prose: ABANDON_DRAIN_CAP is a private const (crates/node/src/node_origin/abandon_drain.rs:68), so an integration binary under tests/ cannot name it. If the cap rises to 15s the margin silently vanishes and teardown breach lines start reporting a false 0/M endpoints closed — the stranded-driver channel that keeps #1675 visible.
#1832 pinned the sibling invariant this way (const _: () = assert!(CONVERGENCE_ROUND_TIMEOUT.as_secs() > client::DHT_CLIENT_TIMEOUT.as_secs())), which works only because DHT_CLIENT_TIMEOUT is pub. Options: make ABANDON_DRAIN_CAP pub and add the same assertion, or add an in-crate #[test] next to its definition asserting the ceiling it must stay under.
3. support::shutdown's breach path is untested
crates/node/tests/support_teardown.rs covers reap's deadline but nothing covers shutdown's: no test asserts that a stalled close still yields Ok(()), nor that the reaped/closed counters in the breach line read what the docstring claims. #1832 added a consumer whose correctness depends on the non-breach path (TestServer::shutdown now checks Endpoint::is_closed after it returns). reap_bounds_a_parked_task shows the pattern is writable under start_paused.
4. Two hygiene items in crates/node/tests/dht_integration.rs
- Module header, lines 1-3 reads "the iterative
FindValuelookup path introduced in PR feat(node): iterative FindValue lookup + negative probe cache (PR 5/5 of #320) #673" — the changelog voice CLAUDE.md forbids ("Present-tense canon... history belongs in git"). Pre-existing; test(node): de-flake the DHT integration suite and unpin two teardown budgets (#1830) #1832 edits the file but not those lines. find_providers_negative_cache_expires_after_ttlno longer tests TTL arithmetic after test(node): de-flake the DHT integration suite and unpin two teardown budgets (#1830) #1832. The mechanism is now "an entry whose absolute expiry is already in the past is swept on the next read" — the docstring says so honestly while the name still promises a TTL elapsing. Considerfind_providers_stops_suppressing_once_the_negative_entry_expires.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity