diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 069cf872245..c051479d462 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -165,10 +165,11 @@ closed, left no finished record, so the final catalog snapshot started the rendition again and replayed a group on its held pad. A failure now counts as the track's end, fixed by [moq-dev/moq#8160](https://github.com/moq-dev/moq/pull/8160). -Added 2026-11-07 (maintainer, /quest-complete): moq-gst's stale-completion -sink test, which failed once in 30 stress iterations in -[moq-dev/moq#8160](https://github.com/moq-dev/moq/pull/8160)'s validation. -It is quarantined with `#[ignore]` until its child fixes it. +moq-gst's stale-completion sink test, which failed once in 30 stress iterations +in [moq-dev/moq#8160](https://github.com/moq-dev/moq/pull/8160)'s validation, +because the sink reported a stopped session as a terminal failure; the session +now tells a stop from a give-up through `Connection::closed`, fixed by +[moq-dev/moq#8246](https://github.com/moq-dev/moq/pull/8246). `js/net`'s lite-07 relative-start integration test, which failed once on main in [moq-dev/moq#8165](https://github.com/moq-dev/moq/pull/8165)'s baseline run, @@ -193,6 +194,5 @@ Public API: none. Wire: none. ## Required - [Fallback playback](/quest/m0/test-flakes-2/ietf22-fallback.md) - a browser viewer follows a fallback within the media lane's bound without dropping its session -- [moq-gst's stale-completion sink test survives load](/quest/m0/test-flakes-2/gst-stale-completion.md) - `a_stale_completion_cannot_end_the_next_publication` passes under stress, and its `#[ignore]` is removed - [The http:// fingerprint tests survive a slow fetch](/quest/m0/test-flakes-2/fingerprint-host-clock.md) - a fingerprint fetch slower than the 500 ms hedge no longer trips the host-clock guard - [A lite-07 reply FINs instead of resetting when the subscriber FINs mid-write](/quest/m0/test-flakes-2/lite07-reply-fin.md) - `js/net`'s empty-window reply test passes under `--rerun-each 200`, fixed in the publisher diff --git a/quest/m0/test-flakes-2/gst-stale-completion.md b/quest/m0/test-flakes-2/gst-stale-completion.md deleted file mode 100644 index bce4fc49c35..00000000000 --- a/quest/m0/test-flakes-2/gst-stale-completion.md +++ /dev/null @@ -1,29 +0,0 @@ -# [S] moq-gst's stale-completion sink test survives load - -## Goal - -`rs/moq-gst/src/sink/imp.rs`'s `a_stale_completion_cannot_end_the_next_publication` -passes reliably under load, fixed at its cause, and its `#[ignore]` is -removed. - -## Plan - -Planned 2026-11-07 (maintainer, /quest-complete) from -[moq-dev/moq#8160](https://github.com/moq-dev/moq/pull/8160)'s validation: -it failed once in a 30-iteration stress run of the moq-gst suite at -[8e2db7b9f6](https://github.com/moq-dev/moq/commit/8e2db7b9f609f1c0992049def7499c268ddcf085). -It is quarantined with `#[ignore]` until this quest fixes it, per AGENTS.md. - -The test starts a session against an unreachable URL, stops it, starts a -second one, and asserts that failing the first session's completion leaves -the second's open and the pad relinked to it. Reproduce it under stress -first and record which assertion fails; that decides whether the sink or -the test is wrong. Candidates: a state transition that returns before the -old session's task lets go of the pad; a second session that hasn't linked -its pad by the time `Paused` returns; or the old session's status task -failing its own completion during shutdown before `stale.fail()` runs, which -breaks the test's assumption rather than the sink. Fix a sink defect in the -sink, never by waiting in the test, and prove it with a test that forces -the losing order. - -Public API: none. Wire: none. diff --git a/rs/moq-gst/src/sink/imp.rs b/rs/moq-gst/src/sink/imp.rs index 7521edfc020..5b405e54259 100644 --- a/rs/moq-gst/src/sink/imp.rs +++ b/rs/moq-gst/src/sink/imp.rs @@ -2236,7 +2236,6 @@ mod tests { // A task outliving its session writes into the handle nobody reads any more. Scoping falls out of // the topology: no id comparison guards the state the pads see. #[test] - #[ignore = "flaky under stress; investigation: quest/m0/test-flakes-2/gst-stale-completion.md"] fn a_stale_completion_cannot_end_the_next_publication() { gst::init().unwrap(); let sink = sink(); diff --git a/rs/moq-gst/src/sink/session.rs b/rs/moq-gst/src/sink/session.rs index bd58d2d95c5..ae76fc791ee 100644 --- a/rs/moq-gst/src/sink/session.rs +++ b/rs/moq-gst/src/sink/session.rs @@ -388,7 +388,6 @@ impl Session { /// wait, that dial outlives the state change an application waits on before it exits (`gst-launch` /// right after NULL). pub fn stop(self) { - // The status task goes first, so it never reports the loop's end as a failure. self.join.abort(); self.connection.abort(moq_net::Error::Cancel); crate::block_on(async { @@ -474,7 +473,13 @@ async fn forward_registered( } notify(&element, &["status", "connected", "moq-version", "connection-stats"]); } - Err(err) => { + Err(_) => { + // `closed` tells a stop from a give-up. A stop is what `Session::stop` asked for: its + // abort cannot cancel a poll already in flight, so the loop's end can reach the task + // before the task ends. + let Err(err) = reconnect.closed().await else { + return; + }; // The reconnect loop stopped on a terminal error (a non-retryable auth failure, or a // bounded backoff's give-up). Ending the publication stops the pad threads feeding a // dead session; losing that race means it already ended, so there is nothing to report. @@ -627,6 +632,26 @@ mod tests { assert!(is_closed(&connection)); } + // The losing order of a stop: the status task polls only after the loop it follows has ended. + #[test] + fn a_local_stop_is_not_a_session_failure() { + let (session, connection) = started(); + let completion = session.completion(); + let status = session.status().clone(); + connection.abort(moq_net::Error::Cancel); + let _ = crate::block_on(connection.closed()); + crate::block_on(forward_registered( + connection, + moq_tokio::origin::spawn(), + status.clone(), + completion.clone(), + glib::WeakRef::new(), + )); + assert!(completion.is_open(), "the stopped publication is not failed"); + assert_ne!(status.status(), ConnectionStatus::Failed); + session.stop(); + } + #[tokio::test] async fn a_terminal_result_waits_until_the_session_is_registered() { let gate = Arc::new(tokio::sync::Notify::new()); diff --git a/sh/gh/test-inventory.allow b/sh/gh/test-inventory.allow index f80facecc94..caf4fab7a9e 100644 --- a/sh/gh/test-inventory.allow +++ b/sh/gh/test-inventory.allow @@ -36,7 +36,6 @@ ignore moq-video::render::export::dx12::tests::exports_an_nv12_texture /quest/m5 ignore moq-video::render::export::dx12::tests::media_foundation_encodes_the_export_in_place /quest/m5/video-hardware.md # Quarantined flakes, re-enabled by the quest that fixes them. -ignore moq-gst::sink::imp::tests::a_stale_completion_cannot_end_the_next_publication /quest/m0/test-flakes-2/gst-stale-completion.md # Need another implementation to speak the route wire; the quest ports it. ignore moq-net::test_interop::lite_tracks_interop /quest/m2/cluster-routing/routes/js.md