From 2cb32d6f6b6ca5054714a4eddae8d7a4092076b0 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 3 Oct 2026 08:46:36 -0700 Subject: [PATCH 1/2] quest(test-flakes-2): export linger test times from stdin close Co-Authored-By: Claude Opus 5.5 --- quest/m1/test-flakes-2/README.md | 1 + quest/m1/test-flakes-2/export-linger.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 quest/m1/test-flakes-2/export-linger.md diff --git a/quest/m1/test-flakes-2/README.md b/quest/m1/test-flakes-2/README.md index 9ca7faaf20..c22470034d 100644 --- a/quest/m1/test-flakes-2/README.md +++ b/quest/m1/test-flakes-2/README.md @@ -32,6 +32,7 @@ Public API: none. Wire: none. - [moq-cli tests on a paused clock](/quest/m1/test-flakes-2/cli-paused-clock.md) - the fetch timeout and completion tests stop racing wall-clock budgets - [Subscription cut by disconnect](/quest/m1/test-flakes-2/subscription-cut.md) - a publisher disconnect never ends a subscription clean +- [Export linger timer](/quest/m1/test-flakes-2/export-linger.md) - the export linger test times from stdin close, not publisher exit - [Media late join](/quest/m1/test-flakes-2/media-late-join.md) - `just test media` late join stays within one GOP, or the regression is fixed ## Related diff --git a/quest/m1/test-flakes-2/export-linger.md b/quest/m1/test-flakes-2/export-linger.md new file mode 100644 index 0000000000..c8497eeb78 --- /dev/null +++ b/quest/m1/test-flakes-2/export-linger.md @@ -0,0 +1,15 @@ +# [XS] Export linger test times from stdin close + +## Goal + +`a_clean_finish_exits_zero_once_the_linger_expires` in +`rs/moq-cli/tests/export.rs` stops failing its `>= 900ms` lower bound under +load, while still proving the export waits out its linger. + +## Plan + +The test starts its timer after the publisher process exits, but the export's +linger starts when the broadcast end reaches it, which can come first. Start +the timer before `drop(stdin)` instead: the broadcast can only end after stdin +closes, so that instant is a correct lower bound. Subprocess test, so a paused +clock can't apply. From f296ecce03d11848e89911dc413d3f16d047998d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 3 Oct 2026 08:46:52 -0700 Subject: [PATCH 2/2] test(cli): time the export linger from stdin close 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 --- quest/m1/test-flakes-2/README.md | 1 - quest/m1/test-flakes-2/export-linger.md | 15 --------------- rs/moq-cli/tests/export.rs | 5 +++-- 3 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 quest/m1/test-flakes-2/export-linger.md diff --git a/quest/m1/test-flakes-2/README.md b/quest/m1/test-flakes-2/README.md index c22470034d..9ca7faaf20 100644 --- a/quest/m1/test-flakes-2/README.md +++ b/quest/m1/test-flakes-2/README.md @@ -32,7 +32,6 @@ Public API: none. Wire: none. - [moq-cli tests on a paused clock](/quest/m1/test-flakes-2/cli-paused-clock.md) - the fetch timeout and completion tests stop racing wall-clock budgets - [Subscription cut by disconnect](/quest/m1/test-flakes-2/subscription-cut.md) - a publisher disconnect never ends a subscription clean -- [Export linger timer](/quest/m1/test-flakes-2/export-linger.md) - the export linger test times from stdin close, not publisher exit - [Media late join](/quest/m1/test-flakes-2/media-late-join.md) - `just test media` late join stays within one GOP, or the regression is fixed ## Related diff --git a/quest/m1/test-flakes-2/export-linger.md b/quest/m1/test-flakes-2/export-linger.md deleted file mode 100644 index c8497eeb78..0000000000 --- a/quest/m1/test-flakes-2/export-linger.md +++ /dev/null @@ -1,15 +0,0 @@ -# [XS] Export linger test times from stdin close - -## Goal - -`a_clean_finish_exits_zero_once_the_linger_expires` in -`rs/moq-cli/tests/export.rs` stops failing its `>= 900ms` lower bound under -load, while still proving the export waits out its linger. - -## Plan - -The test starts its timer after the publisher process exits, but the export's -linger starts when the broadcast end reaches it, which can come first. Start -the timer before `drop(stdin)` instead: the broadcast can only end after stdin -closes, so that instant is a correct lower bound. Subprocess test, so a paused -clock can't apply. diff --git a/rs/moq-cli/tests/export.rs b/rs/moq-cli/tests/export.rs index 3815187993..5363875b43 100644 --- a/rs/moq-cli/tests/export.rs +++ b/rs/moq-cli/tests/export.rs @@ -151,14 +151,15 @@ async fn a_clean_finish_exits_zero_once_the_linger_expires() { let (mut publisher, feeding) = import(&relay); let stdin = feeding.await.unwrap(); output_past(&output, 0).await; + // The linger can't start before stdin closes, but it can before the publisher exits. + let closed = Instant::now(); drop(stdin); assert!(wait(&mut publisher).await.success()); - let finished = Instant::now(); let status = wait(&mut export).await; assert!(status.success(), "a clean finish exits 0, got {status}"); assert!( - finished.elapsed() >= Duration::from_millis(900), + closed.elapsed() >= Duration::from_millis(900), "the export waited out its linger" ); }