From d1e7177d22dfd9fb4f9f0bf941c0ed5ae56fb7be Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 23:01:42 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m0/test-flakes-2/forged-dial-announce.md Quest-Claim: 132349b968f1d0f3 From 08a774ae3f632618ee12c557039f97f9ac17b2ef Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 23:11:09 -0800 Subject: [PATCH 2/2] test(relay): forged-dial test waits for bob's announce before requesting it Mallory's request could sync ahead of bob's server endpoint announce and report Unroutable. Wait for the hidden announce to reach mallory's origin, and do the same for the client-grant test's carried() helper, which shares the race. Un-ignore the test and drop its allowlist entry. Co-Authored-By: Claude Opus 5.5 --- quest/m0/test-flakes-2/README.md | 1 - .../m0/test-flakes-2/forged-dial-announce.md | 31 ------------------- rs/moq-relay/tests/integration/socket_auth.rs | 26 ++++++++++++++-- sh/gh/test-inventory.allow | 1 - 4 files changed, 23 insertions(+), 36 deletions(-) delete mode 100644 quest/m0/test-flakes-2/forged-dial-announce.md diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 6d554a41a6f..51a173d14f1 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -206,5 +206,4 @@ Public API: none. Wire: none. - [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 -- [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 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 d4377a5808d..50fb3e477a5 100644 --- a/sh/gh/test-inventory.allow +++ b/sh/gh/test-inventory.allow @@ -39,7 +39,6 @@ ignore moq-video::render::export::dx12::tests::media_foundation_encodes_the_expo ignore moq-gst::sink::imp::tests::a_stale_completion_cannot_end_the_next_publication /quest/m0/test-flakes-2/gst-stale-completion.md # 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