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
27 changes: 12 additions & 15 deletions js/net/src/lite/publisher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Front } from "../resume.ts";
import { Reader, Stream, Writer, writeBudget } from "../stream.ts";
import { Timescale, Timestamp } from "../time.ts";
import { Subscriber as TrackSubscriber } from "../track.ts";
import { Budget } from "../util/yield.ts";
import { wireOf } from "../wire.ts";
import { type AnnounceBroadcast, AnnounceOk, AnnounceRequest, decodeAnnounceBroadcast } from "./announce.ts";
import { Fetch } from "./fetch.ts";
Expand Down Expand Up @@ -1535,29 +1534,25 @@ test("lite draft-07: a final drop replaces an expired stream", async () => {
// A queued re-offer that a later update drops again as stale counts as given up: the track's end
// leaves that stale drop standing, rather than replacing it with a final one. Mirrors the Rust
// `a_redropped_reoffer_stays_stale_at_the_end_on_lite07`.
// Quarantined: flaky under load, see /quest/m0/test-flakes-2/redropped-reoffer.md
test.skip("lite draft-07: a re-offer dropped again before it opens stays stale at the end", async () => {
test("lite draft-07: a re-offer dropped again before it opens stays stale at the end", async () => {
const clock = new Manual();
const installed = clock.install();
// A write's budget yields on host CPU time, which could run the publisher's post-update task
// before the test writes update 3.
const poll = spyOn(Budget.prototype, "poll").mockReturnValue(undefined);
// Well inside the cache window, so the expired group is still cached to re-offer.
const budget = 1_000;
const update = (update: bigint, maxDelay: number) =>
const update = (update: bigint, maxDelay: number, writer: Writer) =>
new SubscribeUpdate({
priority: 1,
startGroup: 0n,
update,
maxDelay,
...restate(Version.DRAFT_07, update - 1n),
}).encode(sub.client.writer, Version.DRAFT_07);
}).encode(writer, Version.DRAFT_07);
const sub = await servedSubscription({ version: Version.DRAFT_07, startGroup: 0n });
try {
sub.serve(0n);
expect(await sub.servedSequence()).toBe(0n);
expect("start" in (await decodeSubscribeResponse(sub.client.reader, Version.DRAFT_07))).toBe(true);
await update(1n, budget);
await update(1n, budget, sub.client.writer);
// The restated range resolves at once.
expect("started" in (await decodeSubscribeResponse(sub.client.reader, Version.DRAFT_07))).toBe(true);

Expand All @@ -1574,19 +1569,21 @@ test.skip("lite draft-07: a re-offer dropped again before it opens stays stale a
if (!("drop" in first)) throw new Error("expected SUBSCRIBE_DROP");
expect([first.drop.start, first.drop.end, first.drop.update]).toEqual([1n, 1n, 1n]);

// Update 2 widens the budget, so group 1 is re-offered. Update 3 restores it within the
// task the publisher yields after an update, before that re-offer opens.
await update(2n, budget * 100);
await flush();
await update(3n, budget);
// Update 2 widens the budget, so group 1 is re-offered; update 3 restores it. Both arrive in
// one chunk, which the decoder reads without leaving the task, so update 3 is decoded
// before the task boundary the publisher yields after an update, and so before any pop.
const batch = await Writer.collect(Version.DRAFT_07, async (writer) => {
await update(2n, budget * 100, writer);
await update(3n, budget, writer);
});
await sub.client.writer.write(batch);
await flush();
sub.track.finish();
sub.track.close();
expect(await holesToEnd(sub.client.reader)).toEqual([["drop", 1n, 1n, 3n]]);
} finally {
await sub.close();
installed.close();
poll.mockRestore();
}
});

Expand Down
3 changes: 2 additions & 1 deletion js/net/src/lite/tracks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ test("a listing past the announces cap is reset, and the session stays", async (
again.close();
});

test("a flood of a peer's listing churn yields to the host's tasks", async () => {
// 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 () => {
const { subscriber, listed } = handPlayed();
const tracks = subscriber.consume(Path.from("room")).tracks();
const peer = await listed();
Expand Down
1 change: 0 additions & 1 deletion quest/m0/test-flakes-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ 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
- [js/net's bandwidth sampling test holds up under load](/quest/m0/test-flakes-2/bandwidth-sampling.md) - the sampling test counts ticks without racing the mocked clock, and its `test.skip` is removed
- [js/net's lite-07 re-dropped re-offer test holds up under load](/quest/m0/test-flakes-2/redropped-reoffer.md) - update 3 is ordered before the re-offer opens by an event, not a yield count, and its `test.skip` is removed
- [js/net's datagram session-close-after-end test holds up under load](/quest/m0/test-flakes-2/datagram-close-end.md) - the abort is ordered after the end by an event the client observes, and its `test.skip` is removed
- [moq-rs's Python TCP close test settles on a promised error](/quest/m0/test-flakes-2/tcp-close-unroutable.md) - the reader's error after an endpoint close is one the socket contract promises, and its `pytest.mark.skip` is removed
- [js/net's lite-07 datagram queue test holds up under load](/quest/m0/test-flakes-2/datagram-queues.md) - the test waits for the first track's queue instead of asserting at once, and its `test.skip` is removed
29 changes: 0 additions & 29 deletions quest/m0/test-flakes-2/redropped-reoffer.md

This file was deleted.

Loading