diff --git a/js/net/src/lite/publisher.test.ts b/js/net/src/lite/publisher.test.ts index a331a845aef..74e53073fff 100644 --- a/js/net/src/lite/publisher.test.ts +++ b/js/net/src/lite/publisher.test.ts @@ -1057,7 +1057,9 @@ test("lite-07 refuses an update retiring an unknown Range ID", async () => { // A bounded window that resolves empty has no group to answer it, so the publisher answers it // at once. The stream stays open for an update until the subscriber FINs, and the publisher // FINs in reply. -test("lite-07 answers a bounded window that resolves empty and FINs in reply", async () => { +// Quarantined: a subscriber FIN during the reply write's budget yield resets the stream. +// Investigation: quest/m0/test-flakes-2/lite07-reply-fin.md. +test.skip("lite-07 answers a bounded window that resolves empty and FINs in reply", async () => { const version = Version.DRAFT_07; const sub = await servedSubscription({ version, diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index f448acb0bc2..76cd9ac6bb4 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -148,6 +148,12 @@ skipped the timing report. A TERM landing after a lane forked but before hung. The exit trap now waits again, and cancellation reads the job table, fixed by [moq-dev/moq#8138](https://github.com/moq-dev/moq/pull/8138). +Added 2026-11-07 (maintainer's standing rule that flakes join this epic): +`js/net`'s lite-07 empty-window reply test, which fails on main 12/200 under +`--rerun-each 200`, found in [moq-dev/moq#7670](https://github.com/moq-dev/moq/pull/7670). +A subscriber FIN during the reply write's budget yield resets the stream. It is +quarantined with `test.skip` until its child fixes it. + Public API: none. Wire: none. ## Required @@ -156,3 +162,4 @@ Public API: none. Wire: none. - [The datagram-end close follow-up](/quest/m0/test-flakes-2/datagram-end-close.md) - investigate whether duplicate SETUP can override an accepted lite-06 SUBSCRIBE_END during shutdown - [moq-transcode's idle-rung cancel test survives load](/quest/m0/test-flakes-2/transcode-idle-rung-cancel.md) - `cancelling_an_idle_rung_reports_cancel` stops seeing `serve` return before its abort lands - [moq-gst's sink-restart pad test survives load](/quest/m0/test-flakes-2/gst-sink-restart-pads.md) - `a_moqsink_restart_keeps_pads_when_caps_arrive_at_different_times` keeps its pads under load +- [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 diff --git a/quest/m0/test-flakes-2/lite07-reply-fin.md b/quest/m0/test-flakes-2/lite07-reply-fin.md new file mode 100644 index 00000000000..66e7450c50e --- /dev/null +++ b/quest/m0/test-flakes-2/lite07-reply-fin.md @@ -0,0 +1,34 @@ +# [S] A lite-07 reply FINs instead of resetting when the subscriber FINs mid-write + +## Goal + +When a lite-07 subscriber FINs its subscription stream while the publisher's +reply write is yielding on the shared write budget, the publisher still FINs +in reply instead of resetting with Cancel. `js/net/src/lite/publisher.test.ts`'s +"lite-07 answers a bounded window that resolves empty and FINs in reply" +passes under `--rerun-each 200`, and its `test.skip` is removed. + +## Plan + +Planned 2026-11-07 (maintainer, /quest-complete) from +[moq-dev/moq#7670](https://github.com/moq-dev/moq/pull/7670)'s validation: +the test fails on main 12 times in 200 under `bun test --rerun-each 200`. It +is quarantined with `test.skip` until this quest fixes it, per AGENTS.md. + +The bug is in the product, not the test. `Writer.write` +(`js/net/src/stream.ts`) yields on the shared write budget after its bytes +are already queued. During that yield, `SubscriptionControls.response` +(`js/net/src/lite/publisher.ts`) takes the subscriber's clean FIN as +overriding the blocked write, so the publisher resets the stream. +[moq-dev/moq#8047](https://github.com/moq-dev/moq/pull/8047) fixed the same +yield's race for opened group streams only. + +Candidate fixes: + +- a clean FIN no longer overrides a reply write, and only an error does; +- `Writer.write` yields before handing its bytes over, not after. + +Prefer the one that also covers every other `Writer.write` caller whose peer +can FIN during the yield. Check whether the Rust publisher has the same +ordering. Prove the fix with a test that forces the yield, not with repeated +runs.