Repository navigation
test(moq-webrtc): a WHIP publisher past its cap keeps sending until it is closed - #9452
Merged
Merged
Conversation
…t is closed The test sent one Opus packet before the WHIP client connected. A client that connected past the egress's 100 ms delay budget skipped that packet's group, so nothing ever crossed the cap and the session stayed open. The source now sends live until the session ends, as the sibling tests' sources do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 23, 2026 02:57
Contributor
|
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 13 seconds. 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. |
kixelated
enabled auto-merge
November 23, 2026 02:58
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. The test now sends live media until the session ends, so the cap trips whenever the client connects. The root cause was one packet sent before the connect, which the 100 ms delay budget could skip.
Reviewed changes
Live::until: extractsplay's send loop into a generic "send until a future resolves" helper.playis rebuilt on it with the same stale-payload semantics.- Cap test:
a_whip_publisher_past_its_cap_plus_burst_is_closednow usesLiveand waits onlive.until(LOUD, session)inside the existing timeout, replacing the single pre-connect packet.
claude-sonnet-5-5 | 𝕏
kixelated
added a commit
that referenced
this pull request
Nov 25, 2026
#9452 already resends the loud frame until the session closes, which removed the race with the WHIP client's connect. The epic holds no other child, so it completes here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
tests::a_whip_publisher_past_its_cap_plus_burst_is_closedknocked two PRs out of the merge queue under host load (run 45089229485, run 45088080247), sitting out its full 10 s timeout with "the publisher past its cap stayed open: Elapsed".The test sent a single 1000-byte Opus packet before the WHIP client connected. The client's egress subscribes with a 100 ms delay budget (
MAX_DELAYinrs/moq-webrtc/src/egress.rs), and each Opus packet's group ends with the packet. So a client that connected more than 100 ms later skipped that group. The server then received no media, the cap never tripped, and the session stayed open. The cap enforcement itself is fine: it never saw a byte.Approach
The source now sends live, the way the sibling tests' sources already do (
Live, from moq-dev/moq#9275). It sends one 1000-byte packet every 20 ms until the session ends, so whenever the client connects, the next packet trips the 100-byte burst.Live::play's send loop becomesLive::until, which sends until any future resolves, andplayis built on it.I audited the sibling tests. The other tests that wait on media already use
Live.a_capped_whip_publisher_is_steered_by_rembalso sends one packet before connecting, but that packet is a VP8 keyframe whose group stays open, so the delay budget never drops it. A 200 ms injected connect delay passes it onmain, so it is left as is.Mocking the clock doesn't fit this test: it runs real HTTP, ICE, and DTLS over loopback sockets, and a paused tokio clock auto-advances through every I/O wait. The meter's own timing is unit-tested with mocked time in
rate.rs.Impact
Test-only. No public API or wire change.
Validation
push_whip(past the 100 ms budget): onmainthe test fails exactly as in CI,the publisher past its cap stayed open: Elapsedafter 10.23 s. With this change and the same 200 ms pause, it passes in 0.3 s.main(see Approach).systemd-run -p CPUQuota=10%unit:mainfailed 15/15 and this branch passed 15/15.mainpassed 30/30: plain contention on this host didn't open the window, but starving the test of CPU did.cargo test -p moq-webrtc --lib: 109 passed.just checkpasses.Caused by
Models
Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 600d0cb
Base: origin/main at 1fd8509
Risk: low,
The diff changes only test code inside the `mod tests` block of rs/moq-webrtc/src/lib.rs (the WHIP cap test helpers and assertions), so nothing a consumer, peer, or published API relies on can break, and reverting the single file fully undoes it.Classified: low by Claude Code, claude-haiku-5-5, low effort, session
b3d85e46-2352-49be-bae1-3b4ab222fd18Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a20653-35cf-7743-85dd-55c7d943ac4e, round 1Score: 9/10,
Source review found no actionable defects in the test-only change, though tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none