Skip to content

test(cli): time the export linger from stdin close - #4751

Merged
kixelated merged 2 commits into
quest/m1/test-flakes-2/READMEfrom
quest/m1/test-flakes-2/export-linger
Oct 3, 2026
Merged

kixelated merged 2 commits into
quest/m1/test-flakes-2/READMEfrom
quest/m1/test-flakes-2/export-linger

Conversation

@kixelated

@kixelated kixelated commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

a_clean_finish_exits_zero_once_the_linger_expires (rs/moq-cli/tests/export.rs) failed its >= 900ms lower bound in CI on #4725. It started the timer after the publisher process exited, but the export's 1s linger starts when the broadcast end reaches it, which can come first. Under load that gap ate the bound.

Approach

Take the instant before drop(stdin). The broadcast can only end after stdin closes, so the linger can't start sooner and the bound stays correct. Subprocess test, so a paused clock can't apply.

The siblings (a_drop_exits_one_once_the_linger_expires, a_publisher_restarted_within_the_linger_resumes_the_output) assert no elapsed time, so they don't share the race.

Scoped as quest/m1/test-flakes-2/export-linger.md ([XS]) in the first commit and deleted on completion in the second, matching #4715 and #4722. Net diff is the test fix.

Decisions

  • ✅ How should the export linger test stop racing? Start the timer before drop(stdin).
    • Rejected: time from an export event (adds an output contract just for a test).
    • Rejected: drop the elapsed assert (loses the linger coverage).
  • ✅ Where should this land? XS child of test-flakes-2, implemented in the same PR.
    • Rejected: quest only; standalone m1 quest.

Impact

  • Public API: none.
  • Wire: none.

Validation

  • Nix just check: passed.
  • quest check: ok.
  • Stress: cargo nextest run --stress-count 20 of the test alongside 40 yes CPU hogs on 32 cores and a looping cargo nextest run -p moq-net: 20/20 passed.
  • The original code also passed 20/20 under the same load, so the CI failure did not reproduce locally; the fix is by reasoning about the ordering (the timer now starts no later than the earliest point the linger can begin).

Follow-ups

None.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 3, 2026 08:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The export's linger starts when the broadcast end reaches it, which can
precede the publisher process exiting. Timing from that exit let load eat
the 900ms lower bound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 3, 2026 15:57
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging into quest/m1/test-flakes-2/README.

  • Change: a_clean_finish_exits_zero_once_the_linger_expires now starts its timer before drop(stdin), the earliest point the export's linger can begin, so the >= 900ms bound can no longer be eaten by publisher exit latency.
  • CI: Check, Test, macOS, Windows all green on f296ecce03d11848e89911dc413d3f16d047998d.
  • Review: none; skipped as a trivial 3-line test-only change, merge approved by the maintainer.
  • Quest quest/m1/test-flakes-2/export-linger.md was added and deleted within the PR, so the questline is unchanged net.
  • Follow-ups: none.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit 468a89c into quest/m1/test-flakes-2/README Oct 3, 2026
5 checks passed
@kixelated
kixelated deleted the quest/m1/test-flakes-2/export-linger branch October 3, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant