e2e: verify inbound + remote-outbound getStats against real browser media#43
Merged
Conversation
…edia Scenario 2 only asserted onTrack — the receive-side getStats fields added in #40 (inbound jitter/packetsLost/kind/codecId, and the SR-derived remote-outbound-rtp) were never checked against a real sender. Extend the media-receiver helper to poll getStats once a track is flowing and assert: - inbound-rtp: packetsReceived>0, jitter>=0 (real interarrival jitter), kind, and a resolvable codecId; - remote-outbound-rtp: present and linked to the inbound entry via localId, with reportsReceived>0 and a non-null remoteTimestamp. packetsSent is only required non-negative, not positive: it's the SR's sender packet count, which is browser/timing-dependent (Firefox's first SR reports 0, Chrome ~120) — caught by running the Firefox e2e too. Validated against both browsers, including under 5% loss where the helper observed real packetsLost: e.g. Chrome jitter≈0.0012s / packetsSent=122, and a lossy run "packets=119 lost=7". Confirms #40's jitter and loss computation against conditions the loopback unit test can't reproduce. Co-Authored-By: Claude Opus 4.8 <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.
Adds live-browser e2e validation for the receive-side getStats fields shipped in #40 — which were only covered by a loopback unit test (zero jitter, synthetic SR, no loss).
Change
Extend the Scenario 2 media-receiver helper (media_receiver_helper.dart) to poll
getStats()once a track is flowing and assert:packetsReceived>0,jitter>=0(real interarrival jitter),kind, and a resolvablecodecId;localId, withreportsReceived>0and a non-nullremoteTimestamp.packetsSentis only required non-negative, not positive — it's the SR's sender packet count, which is browser/timing-dependent (Firefox's first SR reports 0, Chrome ~120). Running the Firefox e2e caught this.Validation (real browsers)
jitter≈0.0012s,packetsSent=122packetsSent=0(handled)packets=119 lost=7— realpacketsLostmeasuredThis exercises #40's jitter and loss computation under conditions the loopback test can't reproduce.
Notes (from /simplify)
report['inbound-rtp-$ssrc']/report['remote-outbound-rtp-$ssrc']lookups.Test-only change (no lib edits).
dart analyzeclean; 22 e2e pass across Chrome + Firefox.🤖 Generated with Claude Code