From 535f6d3d292a2f0a5cdf79b6d9e0bf15823e333e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 18:11:31 -0800 Subject: [PATCH 1/3] quest: plan the forged-dial test's wait for bob's endpoint Co-Authored-By: Claude Opus 5.5 --- quest/m0/test-flakes-2/README.md | 6 ++++ .../m0/test-flakes-2/forged-dial-announce.md | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+) create 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 381c52bd7f0..e8f9bb30805 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -187,6 +187,11 @@ Added 2026-11-07 (maintainer's standing rule that flakes join this epic): A subscriber FIN during the reply write's budget yield resets the stream. It is quarantined with `test.skip` until its child fixes it. +Added 2026-11-07 (maintainer, /quest-complete): moq-relay's +`socket_auth::a_forged_dial_never_connects`, which failed +[moq-dev/moq#8204](https://github.com/moq-dev/moq/pull/8204)'s Check when +mallory's request for bob's endpoint synced before his announce arrived. + Public API: none. Wire: none. ## Required @@ -196,4 +201,5 @@ Public API: none. Wire: none. - [The embedded relay's sockets are closed when run returns](/quest/m0/test-flakes-2/embed-sockets-outlived.md) - `embed::worker_tokio_custom_route_and_quic` stops failing with "the owner's sockets outlived `run`" - [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 - [moq-tokio's stream-stopped tests survive a loaded host](/quest/m0/test-flakes-2/quic-stream-stopped.md) - `stream_stopped` awaits its stop event instead of a 100 ms wall-clock deadline, and its `#[ignore]` is removed diff --git a/quest/m0/test-flakes-2/forged-dial-announce.md b/quest/m0/test-flakes-2/forged-dial-announce.md new file mode 100644 index 00000000000..a6b2e4207da --- /dev/null +++ b/quest/m0/test-flakes-2/forged-dial-announce.md @@ -0,0 +1,28 @@ +# [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. 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. + +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 (for example, an announced +watch on `.server/bob`) before the forge requests it. Check the file's other +tests that request a freshly announced endpoint without such a wait, and fix +any that share the race. + +Public API: none. Wire: none. From 6703f2feb5d18471f024634b158f00a84938a469 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 18:19:41 -0800 Subject: [PATCH 2/3] test(relay): quarantine the forged-dial flake until its quest fixes it The plan's announce watch needs with_hidden(true), since .server/bob is a hidden route. Co-Authored-By: Claude Opus 5.5 --- quest/m0/test-flakes-2/README.md | 5 +++-- quest/m0/test-flakes-2/forged-dial-announce.md | 15 +++++++++------ rs/moq-relay/tests/integration/socket_auth.rs | 1 + sh/gh/test-inventory.allow | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index e8f9bb30805..8242a4b59d9 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -190,7 +190,8 @@ quarantined with `test.skip` until its child fixes it. Added 2026-11-07 (maintainer, /quest-complete): moq-relay's `socket_auth::a_forged_dial_never_connects`, which failed [moq-dev/moq#8204](https://github.com/moq-dev/moq/pull/8204)'s Check when -mallory's request for bob's endpoint synced before his announce arrived. +mallory's request for bob's endpoint synced before his announce arrived. It is +quarantined with `#[ignore]` until its child fixes it. Public API: none. Wire: none. @@ -201,5 +202,5 @@ Public API: none. Wire: none. - [The embedded relay's sockets are closed when run returns](/quest/m0/test-flakes-2/embed-sockets-outlived.md) - `embed::worker_tokio_custom_route_and_quic` stops failing with "the owner's sockets outlived `run`" - [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 +- [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-tokio's stream-stopped tests survive a loaded host](/quest/m0/test-flakes-2/quic-stream-stopped.md) - `stream_stopped` awaits its stop event instead of a 100 ms wall-clock deadline, and its `#[ignore]` is removed diff --git a/quest/m0/test-flakes-2/forged-dial-announce.md b/quest/m0/test-flakes-2/forged-dial-announce.md index a6b2e4207da..96f46aee49d 100644 --- a/quest/m0/test-flakes-2/forged-dial-announce.md +++ b/quest/m0/test-flakes-2/forged-dial-announce.md @@ -2,7 +2,7 @@ ## Goal -moq-relay's `socket_auth::a_forged_dial_never_connects` passes under load. Mallory +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. @@ -14,15 +14,18 @@ Planned 2026-11-07 (maintainer, /quest-complete). The test failed `Check` on 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. +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 (for example, an announced -watch on `.server/bob`) before the forge requests it. Check the file's other -tests that request a freshly announced endpoint without such a wait, and fix -any that share the race. +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 ba3de064ace..067884ae95d 100644 --- a/rs/moq-relay/tests/integration/socket_auth.rs +++ b/rs/moq-relay/tests/integration/socket_auth.rs @@ -232,6 +232,7 @@ 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; diff --git a/sh/gh/test-inventory.allow b/sh/gh/test-inventory.allow index 76ccc34519f..0b7820f7f14 100644 --- a/sh/gh/test-inventory.allow +++ b/sh/gh/test-inventory.allow @@ -40,6 +40,7 @@ ignore moq-gst::sink::imp::tests::a_stale_completion_cannot_end_the_next_publica # Flaky, disabled until its quest fixes the cause. ignore moq-relay::embed::worker_tokio_custom_route_and_quic /quest/m0/test-flakes-2/embed-sockets-outlived.md +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 From 24eaa57abd9287875eb8d64c46edccd853c21a8b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 21:16:07 -0800 Subject: [PATCH 3/3] quest: plan the qlog accounting wait and the drive expect guard Follow-ups of #8208 and #8226. Co-Authored-By: Claude Opus 5.5 --- quest/m0/test-flakes-2/README.md | 5 ++++ quest/m0/test-flakes-2/qlog-staging-spin.md | 21 +++++++++++++++++ quest/m1/mock-clock-tests/README.md | 1 + .../m1/mock-clock-tests/drive-expect-guard.md | 23 +++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 quest/m0/test-flakes-2/qlog-staging-spin.md create mode 100644 quest/m1/mock-clock-tests/drive-expect-guard.md diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 8242a4b59d9..77de262b228 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -193,6 +193,10 @@ Added 2026-11-07 (maintainer, /quest-complete): moq-relay's mallory's request for bob's endpoint synced before his announce arrived. It is quarantined with `#[ignore]` until its child fixes it. +Added 2026-11-07 (maintainer, /quest-complete): moq-uring's qlog accounting +test, which spins a fixed count waiting on a background thread, from +[moq-dev/moq#8208](https://github.com/moq-dev/moq/pull/8208)'s follow-ups. + Public API: none. Wire: none. ## Required @@ -203,4 +207,5 @@ Public API: none. Wire: none. - [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 - [moq-tokio's stream-stopped tests survive a loaded host](/quest/m0/test-flakes-2/quic-stream-stopped.md) - `stream_stopped` awaits its stop event instead of a 100 ms wall-clock deadline, and its `#[ignore]` is removed diff --git a/quest/m0/test-flakes-2/qlog-staging-spin.md b/quest/m0/test-flakes-2/qlog-staging-spin.md new file mode 100644 index 00000000000..f8c98e913f5 --- /dev/null +++ b/quest/m0/test-flakes-2/qlog-staging-spin.md @@ -0,0 +1,21 @@ +# [XS] moq-uring's qlog accounting test waits on the accounting + +## Goal + +moq-uring's `quic::qlog::tests::an_open_trace_accounts_for_staging_and_close` +passes on a loaded host. It waits for the staged memory to be accounted, not +for a fixed number of spins. + +## Plan + +Planned 2026-11-07 (maintainer, /quest-complete), a follow-up of +[moq-dev/moq#8208](https://github.com/moq-dev/moq/pull/8208). + +The test (`rs/moq-uring/src/quic/qlog.rs`) spins up to 10,000 +`std::thread::yield_now` calls until `sink.inner.memory` reaches the +expected value, which a background thread sets. On a loaded host the thread +can run late and the spins run out first. Wait on the accounting itself, for +example a condition the sink signals when it charges memory, or a blocking +read of the staged state. Don't raise the spin count. + +Public API: none. Wire: none. diff --git a/quest/m1/mock-clock-tests/README.md b/quest/m1/mock-clock-tests/README.md index 092bc3fb18d..089db0745dd 100644 --- a/quest/m1/mock-clock-tests/README.md +++ b/quest/m1/mock-clock-tests/README.md @@ -43,3 +43,4 @@ before starting, since tests land and move. ## Required - [Manual.drive waits for mocked I/O the work is blocked on](/quest/m1/mock-clock-tests/manual-drive-host-io.md) - `drive` stops at the deadline the work meets, and `js/net`'s `driveUntil` workaround is deleted +- [A lint rejects expect(clock.drive(...)).rejects and .resolves](/quest/m1/mock-clock-tests/drive-expect-guard.md) - wrapping `drive` in `expect(...).rejects` or `.resolves` fails lint diff --git a/quest/m1/mock-clock-tests/drive-expect-guard.md b/quest/m1/mock-clock-tests/drive-expect-guard.md new file mode 100644 index 00000000000..4127b112c91 --- /dev/null +++ b/quest/m1/mock-clock-tests/drive-expect-guard.md @@ -0,0 +1,23 @@ +# [XS] A lint rejects expect(clock.drive(...)).rejects and .resolves + +## Goal + +A JS test can't wrap a `Manual` clock's `drive` in +`expect(...).rejects` or `expect(...).resolves`. A lint rule rejects the +pattern with a message pointing at the fix. + +## Plan + +Planned 2026-11-07 (maintainer, /quest-complete), a follow-up of +[moq-dev/moq#8226](https://github.com/moq-dev/moq/pull/8226). + +Bun's `expect(...).rejects` and `.resolves` run a nested event loop, which +silently breaks the order `drive` relies on, and the resulting failure looks +like a clock bug. Today only a doc line in `@moq/clock` warns. Add a +`noRestrictedSyntax`-style rule in `biome.jsonc` (or a GritQL plugin if +biome's built-in rules can't match it) that flags `drive` or `driveUntil` +called inside `expect(...)` followed by `.rejects` or `.resolves`. Its message +says to await `drive` first and assert on the settled result. Fix any existing +matches. + +Public API: none. Wire: none.