From 7c2c9eb04633ac267c0214bf1cfb9209826af317 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 23:14:04 -0700 Subject: [PATCH 1/2] chore(quest): claim quest/m1/js-cache-age-test.md Quest-Claim: 856ede75b89b92e9 From d5360936ea67ed90340d2d6844d7b48a0f042626 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 1 Nov 2026 15:02:43 -0800 Subject: [PATCH 2/2] test(js/net): age the stalled-consumer eviction test past the cache window The test jumped 2s on a track with maxAge 1s, but the JS cache evicts on its fixed 30s idle window, not maxAge, so nothing was evicted. It passed anyway because the default subscription (maxDelay 0) skips a superseded group. Subscribe with no max delay and jump past the cache window plus a scan slice, so only eviction can drop the old group. With #evict made a no-op, the test now fails (received seq 0). Finishes quest/m1/js-cache-age-test.md. Co-Authored-By: Claude Opus 5.5 --- js/net/src/broadcast.test.ts | 14 ++++++++------ quest/m1/README.md | 1 - quest/m1/js-cache-age-test.md | 18 ------------------ 3 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 quest/m1/js-cache-age-test.md diff --git a/js/net/src/broadcast.test.ts b/js/net/src/broadcast.test.ts index dcd8a0bd4fb..182696e672a 100644 --- a/js/net/src/broadcast.test.ts +++ b/js/net/src/broadcast.test.ts @@ -503,16 +503,18 @@ test("a stalled consumer does not pin evicted groups", async () => { clock.jump(Nano.fromMilli(Milli(10_000))); const broadcast = new BroadcastProducer(); - const producer = broadcast.createTrack("video", { timescale: Timescale.MILLI, maxAge: Milli(1000) }); + const producer = broadcast.createTrack("video", { timescale: Timescale.MILLI }); - // A subscriber that never reads. Its sink must not grow without bound. - const stalled = broadcast.track("video").subscribe(); + // A subscriber that never reads. Its sink must not grow without bound. No max delay, + // so only eviction (not a skip of a superseded group) can drop the old group. + const stalled = broadcast.track("video").subscribe({ maxDelay: null }); producer.writeFrame(textFrame("old")); - // Advance past the cache window and write again to trigger a prune. The old - // (closed, aged-out) group is dropped from the stalled sink, not retained. - clock.jump(Nano.fromMilli(Milli(2_000))); + // Advance past the cache window, plus the scan slice a prune may lag by, and write + // again to trigger a prune. The old (closed, aged-out) group is dropped from the + // stalled sink, not retained. + clock.jump(Nano.fromMilli(Milli(30_000 + 30_000 / 8))); producer.writeFrame(textFrame("fresh")); // The next group in arrival order is the fresh one (seq 1): the old (seq 0) group diff --git a/quest/m1/README.md b/quest/m1/README.md index ec184dd6023..aaa1e89be83 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -176,7 +176,6 @@ per-frame CPU growth since #5926. - [CI housekeeping](/quest/m1/ci-housekeeping.md) - remove the actionlint queue ignore once a release after 1.7.12 reaches the dev shell - [crates.io trusts the workflow](/quest/m1/crates-trusted-publisher.md) - maintainer action: every published crate gets a trusted publisher for `release-rs.yml` - [Rust releases publish through OIDC](/quest/m1/release-rs-oidc.md) - release-plz publishes with trusted publishing and `CARGO_REGISTRY_TOKEN` is revoked -- [The JS stalled-consumer eviction test ages its groups](/quest/m1/js-cache-age-test.md) - the test drives the clock the cache reads, so it can fail - [Main is no slower than release](/quest/m1/release-perf/README.md) - every benchmark where main is slower than release is fixed or accepted with a reason, checked by a final paired run before the cut - [Interop coverage](/quest/m1/interop-coverage/README.md) - the riskiest moq-transport features moq-net exposes get cross-implementation tests over drafts 18 and 22 - [Calibrate the paired nightly benchmarks](/quest/m1/bench-ci.md) - A/A and deliberately slowed Nightly runs set the paired comparison's threshold, so its regression alerts can be trusted diff --git a/quest/m1/js-cache-age-test.md b/quest/m1/js-cache-age-test.md deleted file mode 100644 index e062b2a8538..00000000000 --- a/quest/m1/js-cache-age-test.md +++ /dev/null @@ -1,18 +0,0 @@ -# [XS] The JS stalled-consumer eviction test ages its groups - -## Goal - -`js/net/src/broadcast.test.ts` "a stalled consumer does not pin evicted -groups" ages its groups past `maxAge` on the clock the cache actually reads, -so it fails if a stalled consumer does pin evicted groups. - -## Plan - -Decided 2026-10-29 (maintainer), a follow-up of -[moq-dev/moq#7076](https://github.com/moq-dev/moq/pull/7076). The test calls -`setSystemTime`, but the cache ages groups on the monotonic clock, so that -step does nothing. Drive a `Manual` clock past `maxAge` instead, as the -other converted tests do, and restore the ambient clock when it finishes. -Prove the test fails when the consumer is made to pin evicted groups. - -Public API: none. Wire: none.