Skip to content

unit test: Add parallel encoding regression test#143

Open
hanguyen-nuro wants to merge 1 commit intomasterfrom
hanguyen/parallel-encode-test
Open

unit test: Add parallel encoding regression test#143
hanguyen-nuro wants to merge 1 commit intomasterfrom
hanguyen/parallel-encode-test

Conversation

@hanguyen-nuro
Copy link
Copy Markdown
Contributor

Summary

Adds a regression test to ensure processEncodedFrames processes tracks in parallel. This guards against future changes that might inadvertently serialize VP8 encoding.

How it works

  • Injects 10 mock tracks, each with a 50ms encode delay in Read()
  • Calls processEncodedFrames() and measures wall-clock time
  • Asserts total time < 150ms (3x single encode for generous margin)
  • Sequential execution would take ~500ms (10 × 50ms) and fail the assertion

Verified

  • Passes with parallel processEncodedFrames (current master): ~50ms
  • Fails with sequential version (pre-e94246f): ~501ms
=== RUN   TestRTCSender_ProcessEncodedFrames_Parallel
    Error: "501.915234ms" is not less than "150ms"
--- FAIL (sequential)

=== RUN   TestRTCSender_ProcessEncodedFrames_Parallel
--- PASS: 50ms (parallel)

Flakiness

  • Ran 10x with -count=10: 10/10 pass
  • 3x threshold (150ms vs 50ms actual) provides generous margin for CI variance

🤖 Generated with Claude Code

@hanguyen-nuro hanguyen-nuro changed the title Add parallel encoding regression test unit test: Add parallel encoding regression test Apr 3, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.23%. Comparing base (e94246f) to head (6d97fbb).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #143   +/-   ##
=======================================
  Coverage   42.23%   42.23%           
=======================================
  Files          18       18           
  Lines        1636     1636           
=======================================
  Hits          691      691           
  Misses        886      886           
  Partials       59       59           
Flag Coverage Δ
go 42.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Test that processEncodedFrames encodes tracks in
parallel by injecting 10 mock tracks with 50ms
encode delay each. Asserts total wall time < 150ms
(3x single-encode), which would fail at ~500ms if
tracks were processed sequentially.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hanguyen-nuro hanguyen-nuro force-pushed the hanguyen/parallel-encode-test branch from e095043 to 6d97fbb Compare April 3, 2026 20:29
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