Skip to content

test(moq-cli): a killed recording is cut once it holds a fragment of each track - #9017

Merged
kixelated merged 1 commit into
mainfrom
fix/killed-mp4-waits-for-both-tracks
Nov 17, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/killed-mp4-waits-for-both-tracks

Conversation

@kixelated

@kixelated kixelated commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Nightly Tests (rs cli-export) fails on every run since 2026-11-16 (job 133445816078, job 134193526195): export::a_killed_mp4_recording_is_repaired finds one trak in the repaired moov where it expects video and audio.

The repair is right. The killed file holds only audio fragments (track 2), so there is no video to index. The test kills the recorder once the file reaches 10 KB, which it took as "both tracks recorded". That held only because the TS import used to hold its catalog for the two-second mux-rate window, so the export joined mid-stream. Since moq-dev/moq#8829 the catalog goes out with the first media, so the export starts at once. Audio fragments close as their groups end, and the video fragment closes only at the next keyframe, two seconds in. The file reaches 10 KB of audio after about 1 s, before any video fragment lands.

Approach

Wait until the growing file holds a complete moof+mdat fragment of each track, then kill the recorder. The byte count goes. The assertions don't change.

Impact

  • Test only. No public API or wire change.

Alternatives

  • Pass --fragment-duration so video fragments close sooner. That still races audio against video for no gain, and the test would no longer cover the default GOP fragmenting.

Validation

Caused by

  • moq-dev/moq#8829 - stopped the TS import holding its catalog for the mux-rate window, which this test silently depended on to have a video fragment by 10 KB (found by check: nightly cli-export)

Follow-ups

  • export::the_same_instance_within_the_follow_continues failed 1 of 7 local runs at export.rs:605. Not investigated here.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 0cc92ce

  • Base: origin/main at bc66d3e

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1ea93-8f44-7393-a77a-d039a7c0e9cd, round 1

  • Score: 9/10, The test now waits for complete fragments from both tracks instead of an unreliable file-size threshold; source review found no actionable defects, but tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

…each track

The import no longer holds its catalog for the two-second mux-rate window,
so the export starts with the first media and 10 KB of audio fragments land
before the first video GOP closes. Wait for a complete fragment of both
tracks instead of a byte count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 17, 2026 17:35
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56ebfdea-9fb2-4171-a04e-76e79067937a
Commits

Reviewing files that changed from the base of the PR and between bc66d3e and 0cc92ce.

Files selected for processing: 1

  • rs/moq-cli/tests/integration/export.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes: the single commit on rs/moq-cli/tests/integration/export.rs.

  • Wait condition: a_killed_mp4_recording_is_repaired now waits until the growing file holds a complete moof+mdat fragment for two distinct track ids. This replaces the 10 KB size threshold, which audio alone could reach.
  • fragmented helper: it parses the file with the existing boxes, windows over adjacent pairs for Moof followed by Mdat, and collects the tfhd.track_id values. A partial trailing fragment is not counted. The existing boxes(&killed) call already parses a possibly truncated killed file, so mid-write reads are handled the same way.

The assertions are unchanged, and the wait stays bounded by TIMEOUT.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@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: 0cc92cea36c3d86c595917c0955757efc46cb5ef

No blocker. Waiting for two distinct track IDs with a moof followed by a complete mdat checks the state repair actually needs, unlike the byte threshold. mp4-atom's DecodeMaybe returns None on a partial trailing header or sized payload, so the growing file can be polled before that fragment finishes. The default GOP path and post-repair assertions stay intact. Static review; I did not rerun cli-export.

@kixelated
kixelated added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 44c18eb Nov 17, 2026
7 checks passed
@kixelated
kixelated deleted the fix/killed-mp4-waits-for-both-tracks branch November 17, 2026 20:25
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