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
2 changes: 2 additions & 0 deletions quest/m1/test-flakes-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Public API: none. Wire: none.
- [Scoped WARN capture](/quest/m1/test-flakes-2/warn-capture.md) - the drop-unfinished tests count only their own WARNs
- [js/publish audio clock](/quest/m1/test-flakes-2/publish-audio-clock.md) - the audio encoder delay test runs on mock time
- [WebSocket paused TLS dial](/quest/m1/test-flakes-2/websocket-paused-tls.md) - the fixed-address WebSocket tests stop pausing the clock over a real dial
- [moq-mux live import clock](/quest/m1/test-flakes-2/mux-live-import-clock.md) - the live import restart tests advance a paused clock instead of sleeping
- [Tracing capture audit](/quest/m1/test-flakes-2/trace-capture-audit.md) - no test misses tracing events because a parallel test silenced the call site

## Related

Expand Down
40 changes: 40 additions & 0 deletions quest/m1/test-flakes-2/mux-live-import-clock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# [S] moq-mux live import tests on the paused clock

## Goal

The moq-mux live import restart tests (`live_import_restarts_forward_after_idle`
for ts, fmp4, and flv) advance a paused clock across their idle gap and sleep
no real time.

## Plan

Facts (`origin/main`, 2026-10-01): the helpers (`live_import` in
`container/{ts,fmp4}/import_test.rs`, `import` in `flv/import_test.rs`) call
`std::thread::sleep(idle)` with a 300 ms idle. The gap is measured through
`clock::Anchor`, which reads `crate::Clock::now()`, and that is
`std::time::Instant::elapsed()`, so a paused tokio clock can't move it.

Decided (2026-10-01): `crate::Clock`'s monotonic epoch becomes a
`web_async::time::Instant`. That is tokio's clock on native, so the tests start
paused and call `tokio::time::advance`, and it takes `std::time::Instant` off the
wasm path. #4687 used the same `Instant` type, but only for the private SI
debounce after dropping its `crate::Clock`; `Clock` itself still reads
`std::time::Instant`. The wall mapping stays `SystemTime`. Rejected: injecting a `now` into the importers through
`translate_at`, which is plumbing only tests want.

`std::time::Instant` is public at the boundary: `Clock::at(epoch, wall)` is
re-exported from `moq-mux`, and the json and binary timed writes
(`json.rs` `update`/`append`, and their `binary.rs` twins) take
`Timed<_, Instant>` through the crate-private `Clock::stamp`/`capture`.
`moq_net::Timed`'s docs say moq-mux uses `std::time::Instant`. Callers pass
`std::time::Instant` from `test_util::late_clock`, moq-cli publish, moq-hls
export, moq-audio and moq-video capture, and the catalog producer tests.

Open (maintainer, ask before starting): keep the public inputs on
`std::time::Instant` and convert at the boundary (native only; additive, stays
on `main`), or switch them to `web_async::time::Instant` as a typed break on
`dev` and update every caller and doc. Recommended: convert at the boundary,
so only the private epoch moves.

Public API: none if converted at the boundary; otherwise `Clock::at` and the
timed writes change type. Wire: none.
29 changes: 29 additions & 0 deletions quest/m1/test-flakes-2/trace-capture-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# [XS] Tracing captures survive the call-site cache

## Goal

No test in the workspace counts or asserts tracing events through a
thread-scoped subscriber (`with_default`, `set_default`) that a parallel
test can silence under a shared-process `cargo test`.

## Plan

#4690 found that tracing caches, per call site and for the whole process,
whether any subscriber wants its events. With only scoped subscribers, the
first thread to hit a call site decides for everyone, so a parallel test on a
thread with no subscriber turns the event off and the capture misses it.
Nextest runs each test in its own process and can't hit it, but `cargo test`
does.

Start after #4690 lands, with its open review finding on the subscriber
installation window resolved, so the race isn't copied into other crates.

Grep the Rust crates for tests that capture tracing output with scoped
subscribers. Move each one onto #4690's pattern in
`rs/moq-net/src/model/test_tracing.rs` (one process-wide subscriber, events
routed to a per-thread capture). Its helper only counts WARN events by
message, so a capture that asserts something else needs the helper
generalized, or a shared copy if other crates need it. If none turn up, delete
this quest.

Public API: none. Wire: none.
Loading