From 463f7e65d51346028668f90bd7c0cb329d01f725 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 8 Nov 2026 07:55:18 -0800 Subject: [PATCH 1/2] test(net): quarantine two load-sensitive js/net tests Co-Authored-By: Claude Opus 5.5 --- js/net/src/connection/bandwidth.test.ts | 3 ++- js/net/src/lite/datagram-tracks.test.ts | 3 ++- quest/m0/test-flakes-2/README.md | 6 +++++ quest/m0/test-flakes-2/bandwidth-sampling.md | 25 ++++++++++++++++++++ quest/m0/test-flakes-2/datagram-queues.md | 24 +++++++++++++++++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 quest/m0/test-flakes-2/bandwidth-sampling.md create mode 100644 quest/m0/test-flakes-2/datagram-queues.md diff --git a/js/net/src/connection/bandwidth.test.ts b/js/net/src/connection/bandwidth.test.ts index 50081cccbc0..a32a68b0997 100644 --- a/js/net/src/connection/bandwidth.test.ts +++ b/js/net/src/connection/bandwidth.test.ts @@ -116,7 +116,8 @@ test("an idle track on a live connection claims nothing", async () => { } }); -test("a connection samples the transport only while a reservation reads the estimate", async () => { +// Quarantined: flaky under load, see /quest/m0/test-flakes-2/bandwidth-sampling.md +test.skip("a connection samples the transport only while a reservation reads the estimate", async () => { const clock = new Manual(); const installed = clock.install(); let calls = 0; diff --git a/js/net/src/lite/datagram-tracks.test.ts b/js/net/src/lite/datagram-tracks.test.ts index e8c81d01445..d328bc85b19 100644 --- a/js/net/src/lite/datagram-tracks.test.ts +++ b/js/net/src/lite/datagram-tracks.test.ts @@ -111,7 +111,8 @@ test("lite-04 refuses datagram tracks at setup", async () => { } }); -test("lite-07 bounds and prioritizes independent createWritable datagram queues", async () => { +// Quarantined: flaky under load, see /quest/m0/test-flakes-2/datagram-queues.md +test.skip("lite-07 bounds and prioritizes independent createWritable datagram queues", async () => { const source = new Origin(); const publication = source.route(path, { hidden: true }); const datagrams = publication.broadcast.createDatagrams("audio"); diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 926c2707e62..2a50a5253b8 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -199,6 +199,10 @@ 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. +Added 2026-11-08 (maintainer): `js/net`'s bandwidth sampling test and lite-07 +createWritable datagram queue test, which failed under load. Both are +quarantined with `test.skip` until their children fix them. + Public API: none. Wire: none. ## Required @@ -206,3 +210,5 @@ Public API: none. Wire: none. - [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 bandwidth sampling test holds up under load](/quest/m0/test-flakes-2/bandwidth-sampling.md) - the sampling test counts ticks without racing the mocked clock, and its `test.skip` is removed +- [js/net's lite-07 datagram queue test holds up under load](/quest/m0/test-flakes-2/datagram-queues.md) - the createWritable queue test waits on the writes it asserts, and its `test.skip` is removed diff --git a/quest/m0/test-flakes-2/bandwidth-sampling.md b/quest/m0/test-flakes-2/bandwidth-sampling.md new file mode 100644 index 00000000000..20a281d2afb --- /dev/null +++ b/quest/m0/test-flakes-2/bandwidth-sampling.md @@ -0,0 +1,25 @@ +# [XS] js/net's bandwidth sampling test holds up under load + +## Goal + +`js/net/src/connection/bandwidth.test.ts`'s "a connection samples the +transport only while a reservation reads the estimate" passes under load and +runs again. + +## Plan + +Planned 2026-11-08 (maintainer). It failed under load in three worktrees and +passes on a quiet main. It is quarantined with `test.skip` until this quest +fixes it. + +The test counts `getStats` calls over 350 ms of `Manual` clock time and +expects exactly three 100 ms ticks while a reservation reads the estimate, and +none otherwise. Find which step outruns the mocked clock under load: a sample +loop started or stopped on a host task rather than within `advance`, or the +reservation's first read landing after the window opens. Fix it at the cause, +for example by having the test wait on the sampler's start/stop event before +counting, never with a longer window or a retry. Reproduce with +`bun test --rerun-each 200` under a loaded machine first. Then remove the +`test.skip` and delete this quest. + +Public API: none. Wire: none. diff --git a/quest/m0/test-flakes-2/datagram-queues.md b/quest/m0/test-flakes-2/datagram-queues.md new file mode 100644 index 00000000000..dcafde22b83 --- /dev/null +++ b/quest/m0/test-flakes-2/datagram-queues.md @@ -0,0 +1,24 @@ +# [XS] js/net's lite-07 datagram queue test holds up under load + +## Goal + +`js/net/src/lite/datagram-tracks.test.ts`'s "lite-07 bounds and prioritizes +independent createWritable datagram queues" passes under load and runs again. + +## Plan + +Planned 2026-11-08 (maintainer). The test, from +[moq-dev/moq#8276](https://github.com/moq-dev/moq/pull/8276), failed under load. +It is quarantined with `test.skip` until this quest fixes it; #8276 must land +it skipped or fixed. + +Suspects: the test asserts `sendStreams.datagrams` has two queues right after +the first `recv`, and that the oversized appends leave sequence 1 as the next +read, both of which depend on the publisher's write side having run before the +assertion. Under load a write-budget yield can reorder that. Wait on the +event the assertion depends on (the queue's creation, the priority's update +reaching the queue), never a longer timeout or a retry. Reproduce with +`bun test --rerun-each 200` under a loaded machine first. Then remove the +`test.skip` and delete this quest. + +Public API: none. Wire: none. From c5e80d0f4085e7ef5076941750b7d08d92093ca8 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 8 Nov 2026 10:18:35 -0800 Subject: [PATCH 2/2] test(net): quarantine the flaky lite-06 session-close-after-end case Co-Authored-By: Claude Opus 5.5 --- js/net/src/lite/datagram-tracks.test.ts | 4 +++- quest/m0/test-flakes-2/README.md | 5 +++- quest/m0/test-flakes-2/datagram-queues.md | 4 +--- quest/m0/test-flakes-2/session-close-end.md | 26 +++++++++++++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 quest/m0/test-flakes-2/session-close-end.md diff --git a/js/net/src/lite/datagram-tracks.test.ts b/js/net/src/lite/datagram-tracks.test.ts index d328bc85b19..a21a543b307 100644 --- a/js/net/src/lite/datagram-tracks.test.ts +++ b/js/net/src/lite/datagram-tracks.test.ts @@ -470,7 +470,9 @@ for (const alpn of [ALPN_05, ALPN_06, ALPN_07_WIP]) { // A track's end waits a host task for the datagrams received with it. A session close in // between finishes the track rather than cutting it off: the publisher already ended it. for (const alpn of [ALPN_05, ALPN_06, ALPN_07_WIP]) { - test(`${alpn}: a session close right after a datagram track's end keeps the end`, async () => { + // Quarantined: lite-06 fails under load (quest/m0/test-flakes-2/session-close-end.md). + const run = alpn === ALPN_06 ? test.skip : test; + run(`${alpn}: a session close right after a datagram track's end keeps the end`, async () => { const source = new Origin(); const publication = source.route(path, { hidden: true }); const datagrams = publication.broadcast.createDatagrams("audio"); diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 1a6cc22facd..8c35e0346ca 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -200,7 +200,9 @@ 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. Added 2026-11-08 (maintainer): `js/net`'s bandwidth sampling test and lite-07 -createWritable datagram queue test, which failed under load. Both are +createWritable datagram queue test, which failed under load. So is the lite-06 case of the +datagram session-close-after-end test, which dropped +[moq-dev/moq#8280](https://github.com/moq-dev/moq/pull/8280) from the merge queue. All are quarantined with `test.skip` until their children fix them. Added 2026-11-08 (maintainer, /quest-complete): `js/net`'s widened max-age @@ -216,4 +218,5 @@ Public API: none. Wire: none. - [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 bandwidth sampling test holds up under load](/quest/m0/test-flakes-2/bandwidth-sampling.md) - the sampling test counts ticks without racing the mocked clock, and its `test.skip` is removed - [js/net's lite-07 datagram queue test holds up under load](/quest/m0/test-flakes-2/datagram-queues.md) - the createWritable queue test waits on the writes it asserts, and its `test.skip` is removed +- [js/net's lite-06 session-close test keeps the end under load](/quest/m0/test-flakes-2/session-close-end.md) - a session close right after a datagram track's end returns the end, not a `remote error: 0`, and its lite-06 skip is removed - [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/datagram-queues.md b/quest/m0/test-flakes-2/datagram-queues.md index 65d9a5f25e5..1e4df436f9a 100644 --- a/quest/m0/test-flakes-2/datagram-queues.md +++ b/quest/m0/test-flakes-2/datagram-queues.md @@ -8,9 +8,7 @@ independent createWritable datagram queues" passes under load and runs again. ## Plan Planned 2026-11-08 (maintainer). The test, from -[moq-dev/moq#7846](https://github.com/moq-dev/moq/pull/7846), failed under load -in the merge queue, dropping -[moq-dev/moq#8280](https://github.com/moq-dev/moq/pull/8280). +[moq-dev/moq#7846](https://github.com/moq-dev/moq/pull/7846), failed under load. It is quarantined with `test.skip` until this quest fixes it. Suspects: the test asserts `sendStreams.datagrams` has two queues right after diff --git a/quest/m0/test-flakes-2/session-close-end.md b/quest/m0/test-flakes-2/session-close-end.md new file mode 100644 index 00000000000..eb06f97bdde --- /dev/null +++ b/quest/m0/test-flakes-2/session-close-end.md @@ -0,0 +1,26 @@ +# [S] js/net's lite-06 session-close test keeps the end under load + +## Goal + +`js/net/src/lite/datagram-tracks.test.ts`'s "moq-lite-06: a session close right +after a datagram track's end keeps the end" passes under load and runs again. + +## Plan + +Planned 2026-11-08 (maintainer). The lite-06 case failed in the merge queue, +dropping [moq-dev/moq#8280](https://github.com/moq-dev/moq/pull/8280) +([job](https://github.com/moq-dev/moq/actions/runs/42489349640/job/128758087035)): +`reader.recv()` rejected with `Session: remote error: 0` from `closeError` +(`js/net/src/error.ts`) instead of returning the end. The lite-05 and lite-07 +cases still run; the lite-06 case is quarantined with `test.skip`. + +Suspects: the test drains 10,000 microtasks and assumes the end reached the +reader by then. Find which lite-06 step (SUBSCRIBE_FINISH, the FIN, or the +track's host-task wait for its datagrams) can still be pending when +`client.abort()` lands, and whether the library or the test is wrong: the +comment above the test says a close after the end must keep the end. Wait on +that event, never a longer drain, timeout, or retry. Reproduce with +`bun test --rerun-each 200` under a loaded machine first. Then remove the skip +and delete this quest. + +Public API: none. Wire: none.