From 6ae651d1ffb7f73c5847d3f86ebbbe445dad83cc Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 14:01:19 -0800 Subject: [PATCH 1/2] test(net): quarantine flate's tail-shed test and plan its fix Co-Authored-By: Claude Opus 5.5 --- js/net/src/flate/group.test.ts | 3 ++- quest/m0/test-flakes-2/README.md | 4 +++ quest/m0/test-flakes-2/flate-tail-shed.md | 31 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 quest/m0/test-flakes-2/flate-tail-shed.md diff --git a/js/net/src/flate/group.test.ts b/js/net/src/flate/group.test.ts index 09ac20a4525..ce4bd87a358 100644 --- a/js/net/src/flate/group.test.ts +++ b/js/net/src/flate/group.test.ts @@ -68,7 +68,8 @@ test("a slice that fails to decode fails its open group, which takes no more fra }); for (const readPlain of [false, true]) { - test(`compressed tails shed dictionary prefixes without retaining inflated history (plain=${readPlain})`, async () => { + // Quarantined pending quest/m0/test-flakes-2/flate-tail-shed.md. + test.skip(`compressed tails shed dictionary prefixes without retaining inflated history (plain=${readPlain})`, async () => { const group = new Group(0n); hooks.bindGroupCompression(group, true); const raw = group.consume(); diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index 50340c0762a..ab2c952f976 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -101,10 +101,14 @@ tests' shared locked-memory budget, one child each. On 2026-11-06, moq-ffi's concurrent-ready test, quarantined here instead of in the unrelated [moq-dev/moq#7981](https://github.com/moq-dev/moq/pull/7981). +Added 2026-11-06: `js/net`'s flate tail-shed test, which timed out in a +merge-queue batch, one child. + Public API: none. Wire: none. ## Required +- [Flate's tail-shed test passes under load](/quest/m0/test-flakes-2/flate-tail-shed.md) - `js/net`'s compressed tail-shed cases finish within bun's timeout under load, re-enabled once fixed - [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 - [reload.test.ts's close-drain tests pass under load](/quest/m0/test-flakes-2/reload-close-drain.md) - the drain cases in `js/net`'s reload tests pass in loaded multi-file runs - [dispatch-query's terminate test survives load](/quest/m0/test-flakes-2/dispatch-query-terminate.md) - `test_terminating_the_run_stops_the_running_phase` passes reliably under host load, re-enabled once fixed diff --git a/quest/m0/test-flakes-2/flate-tail-shed.md b/quest/m0/test-flakes-2/flate-tail-shed.md new file mode 100644 index 00000000000..ad2bb1ae479 --- /dev/null +++ b/quest/m0/test-flakes-2/flate-tail-shed.md @@ -0,0 +1,31 @@ +# [S] Flate's tail-shed test passes under load + +## Goal + +`compressed tails shed dictionary prefixes without retaining inflated history` +in `js/net/src/flate/group.test.ts`, both `plain` variants, passes reliably +under load, fixed at its cause under the +[epic](/quest/m0/test-flakes-2/README.md)'s rules, never by raising the test +timeout. Restore both cases with every assertion when it is fixed. + +## Plan + +Evidence: the `plain=true` case timed out at bun's 5000 ms default in the +merge-group batch for [moq-dev/moq#7981](https://github.com/moq-dev/moq/pull/7981) +([run 42299125466](https://github.com/moq-dev/moq/actions/runs/42299125466), +Check job, `ci: test js failed`). That PR only touches moq-mux's TS exporter. +Both variants are quarantined with `test.skip`, since they share the loop. + +Lead (unverified): the test is CPU-bound, not waiting on anything. Each of 100 +iterations compresses and inflates a 1 MiB frame, then compares 1 MiB arrays +with `toEqual` once (`plain=false`) or twice (`plain=true`). About 100 MiB of +deflate plus up to 200 element-wise MiB comparisons can approach 5 s on a +loaded runner. If profiling confirms it, shrink the work while keeping what the +test proves (the cache stays bounded and the slow reader is evicted), for +example smaller frames against a proportionally smaller cache bound, or a +cheaper equality check; if the code under test is the slow part, fix that. + +Reproduce first: time the case alone and under CPU contention +(`--rerun-each`) before changing it. + +Public API: none. Wire: none. From a1cedfff2519cec8b5fd9c1bad4d3da2db36a659 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 17:59:27 -0800 Subject: [PATCH 2/2] quest: correct flate tail-shed evidence and record its baseline --- quest/m0/test-flakes-2/flate-tail-shed.md | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/quest/m0/test-flakes-2/flate-tail-shed.md b/quest/m0/test-flakes-2/flate-tail-shed.md index ad2bb1ae479..9d8ad332dd0 100644 --- a/quest/m0/test-flakes-2/flate-tail-shed.md +++ b/quest/m0/test-flakes-2/flate-tail-shed.md @@ -13,17 +13,23 @@ timeout. Restore both cases with every assertion when it is fixed. Evidence: the `plain=true` case timed out at bun's 5000 ms default in the merge-group batch for [moq-dev/moq#7981](https://github.com/moq-dev/moq/pull/7981) ([run 42299125466](https://github.com/moq-dev/moq/actions/runs/42299125466), -Check job, `ci: test js failed`). That PR only touches moq-mux's TS exporter. +Check job, `ci: test js failed`). That PR changes moq-mux's TS exporter, `rs/moq-cli`, +`js/net/src/lite/datagram-tracks.test.ts`, and quest docs; none of it touches +flate or its test, though a `js/net` test-side cause is not ruled out. Both variants are quarantined with `test.skip`, since they share the loop. -Lead (unverified): the test is CPU-bound, not waiting on anything. Each of 100 -iterations compresses and inflates a 1 MiB frame, then compares 1 MiB arrays -with `toEqual` once (`plain=false`) or twice (`plain=true`). About 100 MiB of -deflate plus up to 200 element-wise MiB comparisons can approach 5 s on a -loaded runner. If profiling confirms it, shrink the work while keeping what the -test proves (the cache stays bounded and the slow reader is evicted), for -example smaller frames against a proportionally smaller cache bound, or a -cheaper equality check; if the code under test is the slow part, fix that. +Baseline (unloaded, pre-quarantine file copied aside): both variants together +ran in 1198 ms on the maintainer's dev host; a reviewer measured ~2.1 s per +variant on theirs, with `plain=true` only ~2% slower than `plain=false`. So the +second `toEqual` is not the cost, `plain=false` is no cheaper, and CI's 5697 ms +is a ~2.7x loaded slowdown, not a cliff. + +Lead (unverified): the test is CPU-bound in its 100 iterations that compress +and inflate a 1 MiB frame. If profiling confirms it, cut the work volume while +keeping what the test proves (the cache stays bounded and the slow reader is +evicted), such as smaller frames against a proportionally smaller cache bound, +leaving enough headroom that a ~3x loaded slowdown still fits; if +deflate/inflate in the code under test is the slow part, fix that. Reproduce first: time the case alone and under CPU contention (`--rerun-each`) before changing it.