Skip to content

quest: plan live import clock and tracing capture audit - #4693

Merged
kixelated merged 3 commits into
quest/m1/test-flakes-2/READMEfrom
quest/plan-flake-followups
Oct 2, 2026
Merged

kixelated merged 3 commits into
quest/m1/test-flakes-2/READMEfrom
quest/plan-flake-followups

Conversation

@kixelated

@kixelated kixelated commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Plans two follow-ups in the test-flakes-2 line, from #4687 and #4690.

  • mux-live-import-clock [S]: crate::Clock uses web_async::time::Instant, so the moq-mux live import restart tests advance a paused clock instead of sleeping.
  • trace-capture-audit [XS]: move any scoped tracing captures to moq-net: per-thread WARN capture for the drop tests #4690's process-wide helper, so a parallel test can't silence them through the call-site cache.

Decisions

C goal: the moq-mux live_import tests sleep no real time

  • ✅ Yes
  • Drop it

C shape

  • ✅ Make crate::Clock use web_async::time::Instant
  • Inject a now into the importers

E: plan an audit of tracing-capture tests

  • ✅ Add to the plan, in the test-flakes-2 line
  • Skip it

Review fixes: the #4687 citation no longer implies Clock already moved; the quest lists the public std::time::Instant boundary (Clock::at, json/binary timed writes) and leaves one open question for the maintainer before starting: convert at the boundary on main (recommended) or change the types on dev. The tracing audit waits on #4690 and notes its helper is WARN-specific.

Public API: none from this PR. Wire: none.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

ITERATE (head 1265ae09f385a991e0d35dd7836f9bada5bd2a3f)

Plans two test-flakes-2 children from the #4687 / #4690 line: drive moq-mux live-import idle gaps on a paused clock, and audit scoped tracing captures for the callsite-interest flake. The live-import facts check out on main (ts/fmp4 live_import and flv import still std::thread::sleep(idle) with a 300 ms case; gap goes through Anchor → Clock::now() → std::time::Instant::elapsed(); late_clock pins std::time::Instant).

Blocking

  1. mux-live-import-clock.md mis-cites moq-mux: run the TS SI debounce test on the paused clock #4687. The Decided paragraph says crate::Clock's monotonic epoch becomes web_async::time::Instant “as moq-mux: run the TS SI debounce test on the paused clock #4687 did for the TS SI debounce.” On moq-mux: run the TS SI debounce test on the paused clock #4687’s head (d965302e), SI Capture dropped its crate::Clock and stores a local web_async::time::Instant for the debounce only; rs/moq-mux/src/clock.rs on main still uses std::time::Instant. This plan is a broader Instant-type change than moq-mux: run the TS SI debounce test on the paused clock #4687 shipped. Fix the citation (e.g. “same Instant type moq-mux: run the TS SI debounce test on the paused clock #4687 used for the SI debounce,” not “moq-mux: run the TS SI debounce test on the paused clock #4687 changed Clock”), so the implementer doesn’t treat Clock-wide Instant swap as already-landed precedent.

Non-blocking

  1. Public API is already clear — don’t “check whether.” Clock / Clock::at(epoch: Instant, wall: SystemTime) are pub and re-exported from moq-mux. Swapping Instant to web_async::time::Instant (native: tokio::time::Instant) is a typed break. Call sites already pass std::time::Instant from test_util::late_clock, moq-cli publish tests, moq-hls export tests, moq-audio / moq-video capture fixtures, and catalog tests. Spell the child work as “update callers; Instant change is public API,” not “check whether Clock::at is exported.”

  2. capture / stamp share the Instant surface. Clock::capture / stamp take Instant / Timed<_, Instant>, and moq_net::Timed’s docs say moq-mux uses std::time::Instant. Fold those into the wasm/build checklist with Clock::at, not only the constructor.

  3. trace-capture-audit helper fit. moq-net: per-thread WARN capture for the drop tests #4690’s process-wide helper is WARN/message-specific (count_drop_warnings in rs/moq-net/src/model/test_tracing.rs). Moving “any” scoped capture there may need a more general process-wide + per-thread helper (or a shared copy), not a straight move of every capture onto that WARN counter. (On main the file still uses with_default; the process-wide shape is on moq-net: per-thread WARN capture for the drop tests #4690’s head — fine as a dependency.)

  4. CI still queued at review time (Check / Test / Quest); no failure signal yet.

No “Alternative worth exploring”: Decisions already rejected translate_at injection; the Clock Instant swap is a coherent way to make the production now() path mockable, once the #4687 citation and API blast radius are honest.

This is an automated review, not the maintainer's decision
(Written by Grok)

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed 1265ae0 (full plan diff).

No new actionable findings beyond the existing API-impact clarification. The three import helpers really do sleep through the idle gap, and their anchor reads Clock::now() on std::time::Instant.

Independently confirming and extending the existing API note: replace the uncertain export check in quest/m1/test-flakes-2/mux-live-import-clock.md:24–28 with an explicit boundary decision. Clock::at is already public and re-exported (rs/moq-mux/src/clock.rs:89, lib.rs:45). The same std::time::Instant contract also reaches public binary/JSON timed writes (binary.rs:182,257; json.rs:225,309) through Clock::stamp. Preserve those input contracts deliberately or declare the typed API break and include their callers/docs in the child scope and branch choice. capture and stamp themselves are currently crate-private.

Direction: using the shared mockable monotonic clock is coherent and avoids importer-only time plumbing; retain the fixed wall mapping. #4687 is precedent for the Instant type in private SI debounce code, rather than a completed Clock-wide migration. For trace-capture-audit.md:17–21, adopt the helper after accounting for the open #4690 installation-window finding, rather than copying that unresolved race into other crates. No duplicate inline findings added.

Verification: static plan, dependency-PR, API/caller, and import-test inspection. No code changes, builds, or tests run locally; this does not independently verify the proposed implementations.

(Written by review (OpenAI))

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Delta reviewed: 1265ae0 → ac25d88, separating the inherited #4687/base merge from the two plan updates.

The prior planning concerns are addressed:

  • mux-live-import-clock.md:25–40 now identifies the public constructor and binary/JSON timed-input contracts, covers callers/docs, and requires a maintainer decision between preserving those inputs and an explicit typed break on dev. The #4687 citation correctly limits its precedent to private SI debounce code.
  • trace-capture-audit.md:17–27 now waits for #4690's installation-window finding to be resolved and accounts for the helper's WARN/message-specific scope. This fixes the dependency plan; it does not claim that #4690's implementation is already fixed.

No new actionable findings. Direction remains sound: make the existing clock controllable, preserve its wall mapping, and reuse only the tracing-capture behavior each test actually needs. Keep the API choice as an explicit prerequisite to the implementation.

Verification: static delta and prior-code-context review only. No builds or tests run; this documentation change does not verify either proposed implementation.

(Written by review (OpenAI))

@kixelated

Copy link
Copy Markdown
Collaborator Author

MERGE (re-review after push; head ac25d88ab58eb1aba8e064630148bb2d313d33b6)

Address-review commit clears the prior blockers: #4687 is cited as SI-debounce Instant only (Clock still std::time::Instant), and the Instant/API surface is spelled for implementers.

Prior findings

  1. Fixed — #4687 mis-cite (mux-live-import-clock.md). Decided now says #4687 used the same Instant type only for the private SI debounce after dropping its crate::Clock; Clock itself still reads std::time::Instant. Matches #4687 / current clock.rs on this head.
  2. Fixed — “check whether Clock::at” (mux-live-import-clock.md). Plan states Clock::at is re-exported, lists stamp/capture + json/binary Timed<_, Instant> callers (late_clock, moq-cli/hls/audio/video, catalog tests), and opens a maintainer choice: convert at the boundary (recommended) vs typed break on dev.
  3. Fixed — helper fit (trace-capture-audit.md). Notes #4690’s helper is WARN/message-specific and needs generalization (or a shared copy); also starts only after #4690 lands with its install-window race closed.

Blocking

None.

Non-blocking

  1. CI still pending on this head (Quest queued at review time); no failure signal for a docs-only quest PR.
  2. Open choice is the right gate — not a defect. Boundary convert keeps public Instant on std (matches moq_net::Timed docs); implementers should convert in Clock::at and capture/stamp so “ahead of now” / elapsed ride the tokio clock under start_paused.

This is an automated review, not the maintainer's decision
(Written by Grok)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging. Review fixes in ac25d88: the #4687 citation is limited to the private SI debounce, the live import quest lists the public std::time::Instant boundary and gates on one maintainer choice (convert at the boundary on main, recommended, or a typed break on dev), and the tracing audit waits on #4690 and notes its helper is WARN-specific. Settled decisions unchanged.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit ca455c8 into quest/m1/test-flakes-2/README Oct 2, 2026
4 checks passed
@kixelated
kixelated deleted the quest/plan-flake-followups branch October 2, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant