From fbefc4cb451c157b0ce9d2dd5e867f84a1ff7492 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 18:03:16 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m0/test-flakes-2/datagram-end-close.md Quest-Claim: 8f5a5fd5fc037027 From 1bdffb0e691e0d23176283d9bc84de0e87159382 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 18:24:12 -0800 Subject: [PATCH 2/2] test(net): re-enable the datagram-end close case Its end waited a host task when the publisher's write budget yielded while writing SUBSCRIBE_FINISH under load. #8000 already stubs that budget in the case, and merged after the quarantine was written. Co-Authored-By: Claude Opus 5.5 --- js/net/src/lite/datagram-tracks.test.ts | 4 +- quest/m0/test-flakes-2/README.md | 7 ++- quest/m0/test-flakes-2/datagram-end-close.md | 47 -------------------- 3 files changed, 6 insertions(+), 52 deletions(-) delete mode 100644 quest/m0/test-flakes-2/datagram-end-close.md diff --git a/js/net/src/lite/datagram-tracks.test.ts b/js/net/src/lite/datagram-tracks.test.ts index 2e3ffce68eb..3a843622e5f 100644 --- a/js/net/src/lite/datagram-tracks.test.ts +++ b/js/net/src/lite/datagram-tracks.test.ts @@ -450,10 +450,8 @@ 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. -// Quarantined: the end needs host tasks under load, so the close aborts the track. -// Investigation: quest/m0/test-flakes-2/datagram-end-close.md. for (const alpn of [ALPN_05, ALPN_06, ALPN_07_WIP]) { - test.skip(`${alpn}: a session close right after a datagram track's end keeps the end`, async () => { + test(`${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 b9f9cb1d409..a51389e94c6 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -115,7 +115,11 @@ concurrent-ready test, quarantined here instead of in the unrelated Added 2026-11-06 (maintainer's standing rule that flakes join this epic): `js/net`'s datagram-end close case, which failed [moq-dev/moq#7986](https://github.com/moq-dev/moq/pull/7986)'s Check while -reproducing on unchanged `main`. +reproducing on unchanged `main`. Its end waited a host task when the +publisher's write budget yielded under load while writing SUBSCRIBE_FINISH, past +the case's microtask drain. [moq-dev/moq#8000](https://github.com/moq-dev/moq/pull/8000) +stubbed that budget, merging after the quarantine was written. The case was +re-enabled in [moq-dev/moq#8110](https://github.com/moq-dev/moq/pull/8110). Public API: none. Wire: none. @@ -127,6 +131,5 @@ Public API: none. Wire: none. - [The Python audio playout-delay test reads its frames](/quest/m0/test-flakes-2/audio-playout-delay.md) - `test_audio_consumer_reports_its_playout_delay` stops timing out on its first read in the merge queue - [The dev host's locked-memory limit fits parallel sessions](/quest/m0/test-flakes-2/uring-memlock.md) - the maintainer's host raises the user's `RLIMIT_MEMLOCK`, which Node.js rings from parallel agent sessions fill before io_uring tests start - [The FFI concurrent-ready test wakes both calls under load](/quest/m0/test-flakes-2/ffi-concurrent-ready.md) - `concurrent_ready_calls_all_wake` stops stalling its reader drain under load and is re-enabled -- [The datagram-end close test survives load](/quest/m0/test-flakes-2/datagram-end-close.md) - `a session close right after a datagram track's end keeps the end` stops aborting the track under load and is re-enabled - [lite-05 copy fill checks idleness without wall time](/quest/m0/test-flakes-2/copy-fill-idle.md) - the copy-fill test proves no FETCH went out on the `Manual` clock, not a 200 ms real-time wait - [OBS TSan runs report no leaked FFI worker thread](/quest/m0/test-flakes-2/obs-tsan-thread-leak.md) - the OBS TSan tests stop flagging a finished `moq-ffi-worker` thread at exit under load diff --git a/quest/m0/test-flakes-2/datagram-end-close.md b/quest/m0/test-flakes-2/datagram-end-close.md deleted file mode 100644 index 39259d35445..00000000000 --- a/quest/m0/test-flakes-2/datagram-end-close.md +++ /dev/null @@ -1,47 +0,0 @@ -# [S] The datagram-end close test survives load - -## Goal - -`js/net/src/lite/datagram-tracks.test.ts`'s -`a session close right after a datagram track's end keeps the end` passes -reliably in loaded runs, fixed at its cause under the -[epic](/quest/m0/test-flakes-2/README.md)'s rules, and its `test.skip` is -removed. - -## Plan - -Added 2026-11-06 (maintainer's standing rule that flakes join this epic). -[moq-dev/moq#7986](https://github.com/moq-dev/moq/pull/7986)'s Check failed -in this case, whose diff touches only `bench/`, `justfile`, and quest prose. -It reproduces on unchanged `origin/main`, so the flake came from -[moq-dev/moq#7951](https://github.com/moq-dev/moq/pull/7951)'s new case; -the PR quarantines it with every assertion kept. - -Reproduction 2026-11-06 on this head and on `git archive origin/main`, from -`js/net`, with six CPU loops on four cores: - -- `bun test src/lite/datagram-tracks.test.ts` failed 3 of 4 loaded runs here - and 3 of 3 on `origin/main`; only the lite-06 draft failed, though the - case loops over lite-05, lite-06, and lite-07-wip. -- The same filter `-t "a session close right after a datagram track's end - keeps the end"` passed 10 of 10 idle runs and 8 of 8 loaded runs, so the - whole file (its 37 other cases) is what makes the window miss. -- The failure rejects with `Session: remote error: 0` at `error.ts`'s - `closeError` from `connection.ts`'s `abort`, i.e. `reader.recv()` - rejected instead of ending. - -Likely cause, unverified: the case finishes the datagram track and then -drains only microtasks (`for (i < 1000) await Promise.resolve()`) before -`client.abort()`, assuming "the mock delivers the end in microtasks, all -within this host task". The FIN handler awaits `#datagramsRouted`, which -starts with a host-task `yieldNow`; `Subscriber.close` finishes only -datagram entries whose `ended` is already set and aborts the rest. Under -load the FIN is not read before the abort, so `ended` is still unset and -the producer aborts. Check the delivery point before choosing between -waiting on the end's arrival and yielding to the host in the drain. - -Reproduce first: temporarily remove the case's `test.skip`, then run the -whole file beside CPU loops, as above. Keep the failing output before making -other changes to the test or the end path. Restore the skip until the fix. - -Public API: none. Wire: none.