Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions js/net/src/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ test("integration: lite-07 serves sparse and relative ranges", async () => {
// so counts neither in the largest it reports nor where the copy resolves the start. The copy reports
// the publisher's start, where a reader waiting on each group in sequence starts. Mirrors the Rust
// `a_relative_start_reports_the_publishers_start_over_a_frameless_newest_group`.
// Quarantined: once on main, the start resolved to 0 instead of the publisher's 5.
// Investigation: quest/m0/test-flakes-2/lite07-relative-start.md.
test.skip("integration: lite-07 reports a relative start over a frameless newest group", async () => {
// The newest group lands before the reader asks, as it can under load: a sibling reads it, so the
// reader's own window has yet to settle on it when it asks where it starts.
test("integration: lite-07 reports a relative start over a frameless newest group", async () => {
const pair = createMockTransportPair(Lite.ALPN_07_WIP);
const origin = new OriginProducer();
const [client, server] = await Promise.all([
Expand All @@ -521,15 +521,19 @@ test.skip("integration: lite-07 reports a relative start over a frameless newest
const newest = producer.appendGroup();

const remote = wireOf(client).consume(Path.from("test"));
const reader = remote.track("video").subscribe({ delay: { max: null }, ranges: [{ start: { relative: 0n } }] });
const subscription = { delay: { max: null }, ranges: [{ start: { relative: 0n } }] };
const reader = remote.track("video").subscribe(subscription);
const sibling = remote.track("video").subscribe(subscription);
try {
// Accepting the track subscribes it upstream, whose answer resolves the start.
await reader.info();
expect((await sibling.recvGroup())?.sequence).toBe(5n);
expect(await reader.start()).toBe(5n);
newest.writeFrame({ payload: new Uint8Array([5]) });
newest.finish();
expect((await reader.recvGroup())?.sequence).toBe(5n);
} finally {
sibling.close();
reader.close();
remote.close();
broadcast.close();
Expand Down
3 changes: 3 additions & 0 deletions js/net/src/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3134,6 +3134,9 @@ export class Subscriber {
};
hooks.sourceStart = (subscriber) => {
if (subscriber.#resume) return subscriber.#resume.start();
// A relative anchor still pending reads every group, so a fill asked below would claim
// the history it never names. Mirrors the Rust `cursor.sync()` in `poll_start`.
subscriber.#settle();
const producer = subscriber.#state.producer;
const start = producer && sourceStart(producer);
if (start === "pending") return start;
Expand Down
13 changes: 7 additions & 6 deletions quest/m0/test-flakes-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,18 @@ closed, left no finished record, so the final catalog snapshot started the
rendition again and replayed a group on its held pad. A failure now counts as
the track's end, fixed by [moq-dev/moq#8160](https://github.com/moq-dev/moq/pull/8160).

`js/net`'s lite-07 relative-start integration test, which failed once on main in
[moq-dev/moq#8165](https://github.com/moq-dev/moq/pull/8165)'s baseline run,
read a start of 0 when the newest group landed before the reader asked: its
window had yet to settle the relative anchor, so it asked a fill from group 0.
`start()` now settles the window first, as the Rust `poll_start` does, fixed by
[moq-dev/moq#8197](https://github.com/moq-dev/moq/pull/8197).

Added 2026-11-07 (maintainer, /quest-complete): `js/net`'s
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.

Added 2026-11-07 (maintainer, /quest-complete): `js/net`'s lite-07
relative-start integration test, which failed once on main in
[moq-dev/moq#8165](https://github.com/moq-dev/moq/pull/8165)'s baseline run.
It is quarantined with `test.skip` until its child fixes it.

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).
Expand All @@ -181,5 +183,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
- [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
- [A lite-07 relative start resolves to the publisher's start every time](/quest/m0/test-flakes-2/lite07-relative-start.md) - `js/net`'s frameless-newest-group integration test stops reading a start of 0, and its `test.skip` is removed
- [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
27 changes: 0 additions & 27 deletions quest/m0/test-flakes-2/lite07-relative-start.md

This file was deleted.

Loading