From bf0b0ec095b90d1db836bba2f586fcca0f793679 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 12:59:48 -0800 Subject: [PATCH 1/2] quest: plan the WebTransport hedge timer that outlives its test Co-Authored-By: Claude Opus 5.5 --- quest/m0/test-flakes-2/README.md | 6 ++++++ quest/m0/test-flakes-2/hedge-timer.md | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 quest/m0/test-flakes-2/hedge-timer.md diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index b7cc766a6a8..de20f1c5a44 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -153,6 +153,11 @@ 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, /quest-complete): `js/net`'s +`hedgeWebTransport` timer outliving its test, seen in +[moq-dev/moq#8163](https://github.com/moq-dev/moq/pull/8163)'s CI. The test +it fails varies, so nothing is quarantined. + Public API: none. Wire: none. ## Required @@ -160,3 +165,4 @@ 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-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 +- [No WebTransport hedge timer outlives its test](/quest/m0/test-flakes-2/hedge-timer.md) - `hedgeWebTransport`'s 500 ms timer never fires in a later `js/net` test diff --git a/quest/m0/test-flakes-2/hedge-timer.md b/quest/m0/test-flakes-2/hedge-timer.md new file mode 100644 index 00000000000..26cb27da255 --- /dev/null +++ b/quest/m0/test-flakes-2/hedge-timer.md @@ -0,0 +1,25 @@ +# [S] No WebTransport hedge timer outlives its test + +## Goal + +`hedgeWebTransport`'s 500 ms hedge timer (`js/net/src/connection/connect.ts`) +never fires after the test that armed it, so the `bun test` host-clock guard +never fails an unrelated later test in `js/net/src/connection/connect.test.ts`. + +## Plan + +Planned 2026-11-07 (maintainer, /quest-complete), a follow-up of +[moq-dev/moq#8163](https://github.com/moq-dev/moq/pull/8163), whose CI run +[42402778685](https://github.com/moq-dev/moq/actions/runs/42402778685/job/128493969468) +failed `test js` this way on a PR that doesn't touch `js/net`. The failing +test varies with order, so none is quarantined. + +The hedge races `timeout(WEBTRANSPORT_HEDGE, first)` against the first +dial. Find which test leaves that race pending at its end, and whether +`timeout` disarms its timer when the dial settles or is cancelled. Fix the +cause: a hedge whose dial is cancelled or abandoned must disarm its timer, +and a test that dials must settle or cancel its connect before it ends, or +run on a `Manual` clock. Prove it with a test that ends while the hedge is +pending and asserts no timer stays armed. + +Public API: none. Wire: none. From 67101211d4c2f2464c22d6a039c09a52ea3eba82 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 14:14:40 -0800 Subject: [PATCH 2/2] quest: the fingerprint flake fires in its own test, not a later one Co-Authored-By: Claude Opus 5.5 --- quest/m0/test-flakes-2/README.md | 8 ++--- .../test-flakes-2/fingerprint-host-clock.md | 30 +++++++++++++++++++ quest/m0/test-flakes-2/hedge-timer.md | 25 ---------------- 3 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 quest/m0/test-flakes-2/fingerprint-host-clock.md delete mode 100644 quest/m0/test-flakes-2/hedge-timer.md diff --git a/quest/m0/test-flakes-2/README.md b/quest/m0/test-flakes-2/README.md index de20f1c5a44..65b50a6b3f8 100644 --- a/quest/m0/test-flakes-2/README.md +++ b/quest/m0/test-flakes-2/README.md @@ -154,9 +154,9 @@ 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, /quest-complete): `js/net`'s -`hedgeWebTransport` timer outliving its test, seen in -[moq-dev/moq#8163](https://github.com/moq-dev/moq/pull/8163)'s CI. The test -it fails varies, so nothing is quarantined. +http:// fingerprint tests, whose slow real fetch lets the WebTransport hedge +timer fire on the host clock, seen in +[moq-dev/moq#8163](https://github.com/moq-dev/moq/pull/8163)'s CI. Public API: none. Wire: none. @@ -165,4 +165,4 @@ 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-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 -- [No WebTransport hedge timer outlives its test](/quest/m0/test-flakes-2/hedge-timer.md) - `hedgeWebTransport`'s 500 ms timer never fires in a later `js/net` test +- [The http:// fingerprint tests survive a slow fetch](/quest/m0/test-flakes-2/fingerprint-host-clock.md) - a fingerprint fetch slower than the 500 ms hedge no longer trips the host-clock guard diff --git a/quest/m0/test-flakes-2/fingerprint-host-clock.md b/quest/m0/test-flakes-2/fingerprint-host-clock.md new file mode 100644 index 00000000000..88b998b367d --- /dev/null +++ b/quest/m0/test-flakes-2/fingerprint-host-clock.md @@ -0,0 +1,30 @@ +# [XS] The http:// fingerprint tests survive a slow fetch + +## Goal + +`js/net/src/connection/connect.test.ts`'s http:// fingerprint tests pass +under load: a fingerprint fetch slower than `hedgeWebTransport`'s 500 ms +hedge no longer fires a host-clock timer that the `bun test` guard fails. + +## Plan + +Planned 2026-11-07 (maintainer, /quest-complete), a follow-up of +[moq-dev/moq#8163](https://github.com/moq-dev/moq/pull/8163), whose CI run +[42402778685](https://github.com/moq-dev/moq/actions/runs/42402778685/job/128493969468) +failed `test js` on a PR that doesn't touch `js/net`. The failing test, +"an http:// fingerprint longer than a SHA-256 is refused without reading +the rest" (`connect.test.ts:176` at the time), took 894 ms: its connect +arms the hedge timer before `connectWebTransport` fetches the fingerprint +from a real `Bun.serve` server, the fetch outlasted 500 ms, and the timer +fired on the host clock inside that same test. `timeout` already disarms +when its dial settles (`js/clock/src/timer.ts`), so no timer outlives its +test. + +The three http:// fingerprint tests at `:147`, `:176`, and `:208` talk to a +real HTTP server but lack the `hostTime(); // a real HTTP server` opt-out +their sibling at `:230` carries, which the mock-clock epic's rules allow for +real I/O. Decide in the PR between adding that opt-out and arming the hedge +only after the fingerprint resolves, so a slow fetch can't start a second +dial. Prove it by delaying the fingerprint response past the hedge. + +Public API: none. Wire: none. diff --git a/quest/m0/test-flakes-2/hedge-timer.md b/quest/m0/test-flakes-2/hedge-timer.md deleted file mode 100644 index 26cb27da255..00000000000 --- a/quest/m0/test-flakes-2/hedge-timer.md +++ /dev/null @@ -1,25 +0,0 @@ -# [S] No WebTransport hedge timer outlives its test - -## Goal - -`hedgeWebTransport`'s 500 ms hedge timer (`js/net/src/connection/connect.ts`) -never fires after the test that armed it, so the `bun test` host-clock guard -never fails an unrelated later test in `js/net/src/connection/connect.test.ts`. - -## Plan - -Planned 2026-11-07 (maintainer, /quest-complete), a follow-up of -[moq-dev/moq#8163](https://github.com/moq-dev/moq/pull/8163), whose CI run -[42402778685](https://github.com/moq-dev/moq/actions/runs/42402778685/job/128493969468) -failed `test js` this way on a PR that doesn't touch `js/net`. The failing -test varies with order, so none is quarantined. - -The hedge races `timeout(WEBTRANSPORT_HEDGE, first)` against the first -dial. Find which test leaves that race pending at its end, and whether -`timeout` disarms its timer when the dial settles or is cancelled. Fix the -cause: a hedge whose dial is cancelled or abandoned must disarm its timer, -and a test that dials must settle or cancel its connect before it ends, or -run on a `Manual` clock. Prove it with a test that ends while the hedge is -pending and asserts no timer stays armed. - -Public API: none. Wire: none.