Repository navigation
test(moq-cli): a killed recording is cut once it holds a fragment of each track - #9017
Conversation
…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>
|
Warning Review limit reachedYou'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. View limit details
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. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: the single commit on rs/moq-cli/tests/integration/export.rs.
- Wait condition:
a_killed_mp4_recording_is_repairednow 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. fragmentedhelper: it parses the file with the existingboxes, windows over adjacent pairs forMooffollowed byMdat, and collects thetfhd.track_idvalues. A partial trailing fragment is not counted. The existingboxes(&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.
claude-sonnet-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
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.

Problem
Nightly
Tests (rs cli-export)fails on every run since 2026-11-16 (job 133445816078, job 134193526195):export::a_killed_mp4_recording_is_repairedfinds onetrakin the repairedmoovwhere 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
Alternatives
--fragment-durationso 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
just rs cli-export: same failure,left: 1, right: 2. A dump of the killed file showed 11 moofs, all fortrack_id 2.5b4c01b749, fails at2c3eb75003(feat(moq-mux): only a padded TS export waits for the mux rate #8829). Reverting the other suspect,f3ed57eea1(perf(moq-mux): a container export steps to the next group before scanning every pending one #8865), did not help.just rs cli-exportsuite passes (16/16), and the fixed test passed 7 of 7 runs, at about 4.1 s each (it now waits out the first GOP).export::the_same_instance_within_the_follow_continues(export.rs:605, "the returned output carries the capture's new tail"). See Follow-ups.just cipasses.Caused by
Follow-ups
export::the_same_instance_within_the_follow_continuesfailed 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 reviewafter 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 mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1ea93-8f44-7393-a77a-d039a7c0e9cd, round 1Score: 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