From b56525c458bac148abb5e6cbc7056421810cc6b0 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 02:18:55 -0800 Subject: [PATCH 1/3] chore(quest): claim quest/m0/test-flakes-3/listing-yield.md Quest-Claim: 388bbf4f1dc20bc6 From 33dfccc685bdeb8b8548dfd1f3745333ff5eda22 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 02:41:16 -0800 Subject: [PATCH 2/3] test(net): stub the listing budget's CPU clock instead of sizing the flood to real time The listing-churn yield test flooded 40k events so the budget's 4 ms CPU slice would pass on real time, which took 1-2 s under 48 CPU burners and timed out in loaded full runs. Stub performance.now as the stream accept flood test does, so every 32nd check yields, and shrink the flood to 2k events. Unquarantine it. Co-Authored-By: Claude Opus 5.5 --- js/net/src/lite/tracks.test.ts | 11 ++++++++--- quest/m0/test-flakes-3/listing-yield.md | 19 ------------------- 2 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 quest/m0/test-flakes-3/listing-yield.md diff --git a/js/net/src/lite/tracks.test.ts b/js/net/src/lite/tracks.test.ts index 00cd804a60d..b56cf1fae8f 100644 --- a/js/net/src/lite/tracks.test.ts +++ b/js/net/src/lite/tracks.test.ts @@ -250,15 +250,20 @@ test("a listing past the announces cap is reset, and the session stays", async ( again.close(); }); -// Quarantined: timed out at 5 s in 2 of 30 full js/net runs under 48 CPU burners; see moq-dev/moq#8355. -test.skip("a flood of a peer's listing churn yields to the host's tasks", async () => { +// The budget's CPU slice is stubbed to pass on every check, so the yield does not depend on load +// and a short flood still spans many slices. +// biome-ignore lint/style/noRestrictedGlobals: stubs the host CPU clock the budget reads. +const host = performance; +test("a flood of a peer's listing churn yields to the host's tasks", async () => { + let fakeNow = 0; + spyOn(host, "now").mockImplementation(() => (fakeNow += 5)); const { subscriber, listed } = handPlayed(); const tracks = subscriber.consume(Path.from("room")).tracks(); const peer = await listed(); // Churn of one name never reaches the announces cap, so only the budget bounds it. const flood = await bytes(async (w) => { await encodeTracksEvent(w, { kind: "added", name: "first", info }, version); - for (let i = 0; i < 20_000; i++) { + for (let i = 0; i < 1024; i++) { await encodeTracksEvent(w, { kind: "added", name: "churn", info }, version); await encodeTracksEvent(w, { kind: "removed", name: "churn" }, version); } diff --git a/quest/m0/test-flakes-3/listing-yield.md b/quest/m0/test-flakes-3/listing-yield.md deleted file mode 100644 index d4f7c9a4dbc..00000000000 --- a/quest/m0/test-flakes-3/listing-yield.md +++ /dev/null @@ -1,19 +0,0 @@ -# [S] A peer's listing churn yields to the host's tasks, unquarantined - -## Goal - -`js/net`'s "a flood of a peer's listing churn yields to the host's tasks" -(`js/net/src/lite/tracks.test.ts`) runs again and passes under a loaded -`just check`, fixed at its cause on a mocked clock or an awaited event, never -with a looser budget. - -## Plan - -Found 2026-11-14 by the [feature review](/quest/m3/release/feature-review.md)'s -first pass: [moq-dev/moq#8355](https://github.com/moq-dev/moq/pull/8355) -skipped it after it timed out at 5 s in 2 of 30 full `js/net` runs under 48 -CPU burners, while that PR fixed a different test, so no quest owned the -quarantine. Reproduce under the same load first, then decide whether the -budget loop or the test's wait is at fault, following this epic's rules. - -Public API: none. Wire: none. From 0f9be04bed689aac46fe1ec2418e6fa9baf8eda9 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 03:06:00 -0800 Subject: [PATCH 3/3] test(net): start the stubbed CPU clock from real time, past the shared budget's slice start Co-Authored-By: Claude Opus 5.5 --- js/net/src/lite/tracks.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/net/src/lite/tracks.test.ts b/js/net/src/lite/tracks.test.ts index b56cf1fae8f..36f35d3a1de 100644 --- a/js/net/src/lite/tracks.test.ts +++ b/js/net/src/lite/tracks.test.ts @@ -255,7 +255,8 @@ test("a listing past the announces cap is reset, and the session stays", async ( // biome-ignore lint/style/noRestrictedGlobals: stubs the host CPU clock the budget reads. const host = performance; test("a flood of a peer's listing churn yields to the host's tasks", async () => { - let fakeNow = 0; + // Starts from the real time, since the shared budget may hold a real slice start. + let fakeNow = host.now(); spyOn(host, "now").mockImplementation(() => (fakeNow += 5)); const { subscriber, listed } = handPlayed(); const tracks = subscriber.consume(Path.from("room")).tracks();