Skip to content

Follow-ups from the #1832 review: a client-pull scheduler flake, an unpinnable teardown invariant, and two test-hygiene items #1840

Closed

Description

@yigitdot

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

Activity

  1. added
    kind:bug
    kind:test
    rust
    prio:medium
    on Aug 26, 2026
  2. moved this from Backlog to Ready in deCDNon Aug 26, 2026
  3. self-assigned this
    on Aug 27, 2026
  4. moved this from Ready to In progress in deCDNon Aug 29, 2026
  5. moved this from In progress to Done in deCDNon Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:bugkind:testprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions