diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 199497632b4..c5405663273 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -208,6 +208,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-relay's forged-dial test waits for bob's endpoint](/quest/m0/test-flakes-2/forged-dial-announce.md) - `a_forged_dial_never_connects` requests bob's endpoint only after its announce reaches mallory, and its `#[ignore]` is removed - [moq-uring's qlog accounting test waits on the accounting](/quest/m0/test-flakes-2/qlog-staging-spin.md) - `an_open_trace_accounts_for_staging_and_close` waits for the accounting, not 10,000 spins - [js/net's widened max-age re-drop test ends cleanly, not with a reset](/quest/m0/test-flakes-2/widened-max-age-reset.md) - the test finishes the track only after the re-drop reply arrives, so the end is a FIN, and drops its wall-clock assert diff --git a/quest/m0/test-flakes-2/forged-dial-announce.md b/quest/m0/test-flakes-2/forged-dial-announce.md deleted file mode 100644 index 96f46aee49d..00000000000 --- a/quest/m0/test-flakes-2/forged-dial-announce.md +++ /dev/null @@ -1,31 +0,0 @@ -# [XS] moq-relay's forged-dial test waits for bob's endpoint - -## Goal - -moq-relay's `socket_auth::a_forged_dial_never_connects` passes under load and runs again. Mallory -asks for bob's server endpoint only once it has reached her session, so -the request never syncs ahead of bob's announce. - -## Plan - -Planned 2026-11-07 (maintainer, /quest-complete). The test failed `Check` on -[moq-dev/moq#8204](https://github.com/moq-dev/moq/pull/8204) -([run 42430262086](https://github.com/moq-dev/moq/actions/runs/42430262086)), -which touches no relay, socket, or origin code. It panicked at -`rs/moq-relay/tests/integration/socket_auth.rs:251` with -`bob's endpoint: Unroutable`. It passed 40 stress runs alone and 18 more -inside the loaded relay suite. It is quarantined with `#[ignore]` and a -`sh/gh/test-inventory.allow` entry until this quest fixes it. - -Bob's first `poll_accept_tcp` only starts his server endpoint's announce, -which still has to cross bob's session, the relay, and mallory's session. -`origin::Consumer::request` reports `Unroutable` once discovery has synced -without a covering route, so mallory's request can sync first. Have the test -wait for the announce to reach mallory's origin before the forge requests -it. `.server/bob` is a hidden route (a `.`-named segment), so an announced -watch needs `with_hidden(true)` to see it. Check the file's other tests that -request a freshly announced endpoint without such a wait, and fix any that -share the race. Then remove the `#[ignore]` and the allowlist entry, and -delete this quest. - -Public API: none. Wire: none. diff --git a/rs/moq-relay/tests/integration/socket_auth.rs b/rs/moq-relay/tests/integration/socket_auth.rs index 067884ae95d..d96b2f984d4 100644 --- a/rs/moq-relay/tests/integration/socket_auth.rs +++ b/rs/moq-relay/tests/integration/socket_auth.rs @@ -202,6 +202,25 @@ async fn recv(reader: &mut moq_net::track::Ordered) -> Vec { .expect("read timeout") } +/// Wait until `id`, a hidden endpoint, is announced to `origin`, so a request for it +/// never syncs ahead of the announce and reports it unroutable. +async fn announced(origin: &moq_net::origin::Producer, id: &str) { + let mut announced = origin.consume().with_hidden(true).announced(); + let wait = async { + while let Some(event) = announced.next().await { + if let moq_net::announce::Event::Present(announce) = event + && announce.prefix.as_str() == id + { + return; + } + } + panic!("{id}: origin closed"); + }; + kio::clock::timeout(TIMEOUT, wait) + .await + .unwrap_or_else(|_| panic!("{id} was never announced")); +} + /// The prefix grants admit a dial and its accept in either protocol, and the session /// carries data, over moq-lite-07 and across a moq-transport hop. #[tokio::test] @@ -232,7 +251,6 @@ async fn prefix_grants_admit_a_session() { /// name. Bob sees a dial from alice, but alice never dialed it and resets his accept, so it /// never connects and mallory reads nothing. #[tokio::test] -#[ignore = "flaky: mallory's request can sync before bob's announce arrives; quest/m0/test-flakes-2/forged-dial-announce.md"] async fn a_forged_dial_never_connects() { let fixture = Fixture::new().await; let (alice, _alice_origin, _alice_session) = fixture.endpoint(Role::Client, "alice", LITE).await; @@ -243,6 +261,7 @@ async fn a_forged_dial_never_connects() { // Bob's first accept announces his server endpoint. assert!(bob.poll_accept_tcp(&kio::Waiter::noop()).is_pending()); + announced(&mallory_origin, ".server/bob").await; let forge = async { let broadcast = mallory_origin @@ -275,9 +294,10 @@ async fn a_client_grant_neither_serves_nor_reads_clients() { let (_bob, bob_origin, _bob_session) = fixture.endpoint(Role::Server, "bob", LITE).await; // Bob, a server, reads a client endpoint once the relay carries it. let carried = |id: &'static str| { - let origin = bob_origin.consume(); + let origin = bob_origin.clone(); async move { - kio::clock::timeout(TIMEOUT, origin.request(id, None)) + announced(&origin, id).await; + kio::clock::timeout(TIMEOUT, origin.consume().request(id, None)) .await .expect("request timeout") .unwrap_or_else(|err| panic!("{id}: {err}")); diff --git a/sh/gh/test-inventory.allow b/sh/gh/test-inventory.allow index 85303d41dd0..b808c2889cc 100644 --- a/sh/gh/test-inventory.allow +++ b/sh/gh/test-inventory.allow @@ -38,7 +38,6 @@ ignore moq-video::render::export::dx12::tests::media_foundation_encodes_the_expo # Quarantined flakes, re-enabled by the quest that fixes them. # Flaky, disabled until its quest fixes the cause. -ignore moq-relay::socket_auth::a_forged_dial_never_connects /quest/m0/test-flakes-2/forged-dial-announce.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