Skip to content

test(cli): keep the TS resume capture on its media clock - #5710

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/test-flakes-2/ts-resume-late-frames
Oct 16, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/test-flakes-2/ts-resume-late-frames

Conversation

@kixelated

@kixelated kixelated commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Completes quest/m1/test-flakes-2/ts-resume-late-frames.md.

Cause: the fixture

I looped the_same_instance_within_the_linger_continues on a host at load 60 to 170 (24 cores), with the exporter stderr and timings printed. In 5 of 6 runs the exporter logged frame missed its deadline; dropped, 22 to 32 frames per run. The run with no drops was the only one where the export wrote within 134 ms.

  • The fixture stopped feeding as soon as the catalog's PCR-rate gate opened, then waited for the export's first write.
  • With no new media, the export's clock acquisition waited out its two-delay bound, so that wait took about 2.4 s. The reconnect itself took 10 to 130 ms.
  • The export releases frames 1 s (--delay) behind the source, so a 2.4 s pause in the media made every resumed frame late, and they were dropped.
  • The test passed only when a frame flushed late at the end happened to carry a newer PTS than the prefix.

A real publisher keeps its media clock running through a connection loss, so the exporter is behaving as designed. The fixture was the problem.

Fix

  • The capture is fed on a fixed 150 ms tokio::time::interval, which bursts whatever chunks a stall held back, and it keeps publishing until the export has written. Waiting on the export or the reconnect no longer pauses the media.
  • The 2.9 s bbb_cbr.ts ran out before the export could write (2 s gate plus 1 s delay). I added bbb5s_cbr.ts, a 5 s, 400 kb/s CBR remux of the same scte35/bbb5s.ts source (255 KB; the ffmpeg command is in the const doc). Only this test uses it.
  • The new-content assertion is unchanged. No retries, timeouts or delays were widened.

After the fix, 6 sequential runs and 16 runs in batches of 8 concurrent copies, all under load, passed with dropped=0. Each export output the whole capture.

Impact

  • Public API: none. Wire: none. Test-only, plus one test asset.
  • Possible shared cause with ts-video-content: no. That quest's suspect is the zero max_delay live subscription at startup. Here the drops came from the fixture's own pause in the media.

Checks

  • just check passed: 3196 default, 466, 192, 97 and 10 tests, plus lint, flake and quest checks.

Decisions

  1. No zero-drop assertion (no missed its deadline check on the exporter's stderr). It would catch this exact regression, but it ties the verdict to host scheduling under extreme load. The maintainer confirmed keeping only the new-content assertion the quest asked for.

Suggested follow-ups

  • The test spends about 10 s of its 18 s waiting out --linger 10s after the clean finish. A shorter linger that still covers the reconnect would speed up CI. Recommendation: a small quest, only if CI time matters.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits October 16, 2026 07:44
The same-instance resume test paused its capture at the PCR-rate gate,
waited for the export's first write, then reconnected. With no new media,
the export's acquisition waited out its two-delay bound, so the capture
stood still about 2.4 s under load. The export runs a 1 s delay behind the
source, so every resumed frame arrived late and was dropped; the test
passed only when a late-flushed tail happened to carry a newer timestamp.

Feed the capture on a fixed 150 ms schedule that bursts whatever a stall
held back, publish until the export has written, and use a 5 s CBR remux
of the same source so media remains after the catalog gate and the
export's delay. Loaded runs now drop no frames.

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

Copy link
Copy Markdown
Collaborator Author

Outcome: the drops came from the fixture, not the exporter or relay. The capture paused about 2.4 s while the export acquired its clock, which is longer than the export's 1 s delay. The capture now stays on its schedule, and it uses a 5 s clip. Loaded runs: 22/22 passed, all with dropped=0. One open decision (whether to also assert zero drops; recommended no) is in the description. Left as a draft.

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review October 16, 2026 16:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:19:26.601523Z 1d90c8d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 commit 1d90c8d.

No actionable bugs found. Reusing one absolute pacing interval across startup and reconnect is a focused fixture correction, and the longer capture preserves a meaningful tail without widening timeouts or weakening the new-content assertion. The test still exercises actual connection loss, verifies replacement of the relay copy under the same epoch, and requires output timestamps beyond the input prefix supplied before disconnect.

Verification limits: static review of the diff, full test fixture and relevant TS export/follower code only. I did not run tests, reproduce load conditions or independently decode the binary media asset; the reported passing runs are author-provided.

(Written by OpenAI)

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26c1e503-efe2-4b5a-841c-9a1c5c625691
📥 Commits

Reviewing files that changed from the base of the PR and between ef21a30 and 1d90c8d.

📒 Files selected for processing: 4
  • quest/m1/test-flakes-2/README.md
  • quest/m1/test-flakes-2/ts-resume-late-frames.md
  • rs/moq-cli/tests/export.rs
  • rs/moq-mux/src/container/ts/test_data/bbb5s_cbr.ts
💤 Files with no reviewable changes: 2
  • quest/m1/test-flakes-2/ts-resume-late-frames.md
  • quest/m1/test-flakes-2/README.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

Walkthrough

The export integration test now uses a five-second TS capture, paced in 150 ms intervals, across a same-instance publisher reconnect. It checks output timestamps against the published prefix and verifies that output after the reconnect mark contains the capture’s new tail. The test retains checks for the catalog clock and PSI version. The Required list entry and investigation document for the TS resume late-frames quest were removed.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1d90c

The reconnect test continues to check for new media after resuming. No concrete merge-blocking regression is established, so the change appears mergeable under normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main test change: keeping the TypeScript resume capture on its media clock.
Description check Passed The description directly explains the fixture timing issue, the continuous capture fix, the longer test asset, validation results, and test-only scope.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.1)

Clippy execution timed out

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary

  • The TS resume test's capture now keeps a fixed 150 ms schedule on a 5 s CBR clip and publishes until the export writes, so waiting on the export or the reconnect no longer pauses the media and makes resumed frames late. Test-only, plus one test asset. No API or wire impact.
  • Decision: no zero-drop assertion. The maintainer confirmed keeping only the new-content assertion, so the verdict does not depend on host scheduling under extreme load.
  • Merged latest main. The earlier TS validation failure was the known source-drift flake in TS full multiplex at its own rate, which fix(moq-mux): judge a source's clock on slack the floors saw #5714 addresses; it passed on the rerun.
  • Reviews on 1d90c8d: OpenAI review with no findings, Codex thumbs-up, CodeRabbit with no findings.
  • Follow-up: the test spends about 10 s waiting out --linger 10s; a shorter linger could cut CI time if that matters.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 730d5df Oct 16, 2026
14 checks passed
@kixelated
kixelated deleted the quest/m1/test-flakes-2/ts-resume-late-frames branch October 16, 2026 17:13
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