Skip to content

fix(tests): unblock AudioProcessingTrack recv() silence tests#1022

Merged
leszko merged 1 commit intomainfrom
rafal/fix-audio-track-test-hangs
Apr 30, 2026
Merged

fix(tests): unblock AudioProcessingTrack recv() silence tests#1022
leszko merged 1 commit intomainfrom
rafal/fix-audio-track-test-hangs

Conversation

@leszko
Copy link
Copy Markdown
Collaborator

@leszko leszko commented Apr 30, 2026

Summary

  • CI test runs were timing out at ~2h (recent runs cancelled at 1h43m / 1h56m / 2h0m). Root cause: PR Delay A/V in WebRTC until both tracks have been seen. #1001 ("Delay A/V in WebRTC until both tracks have been seen.") changed AudioProcessingTrack.recv() so the first call now blocks in _wait_for_initial_audio() until enough audio has been buffered, but three tests in tests/test_audio_processing_track.py still constructed tracks with started=False and fed no / insufficient / paused audio — so recv() looped forever.
  • Drop started=False from the silence-fallback tests (test_no_audio_returns_silence, test_paused_returns_silence, test_undersized_chunk_returns_silence) so they exercise the post-anchor recv() path, which is the path these silence-fallback assertions actually care about.
  • Local pytest now completes in ~70s instead of hanging.

Test plan

  • uv run pytest tests/test_audio_processing_track.py -v — 30/30 pass in ~1.2s
  • uv run pytest — full suite completes in ~70s (vs. previously hanging on test_no_audio_returns_silence)
  • uv run ruff check tests/test_audio_processing_track.py clean
  • uv run ruff format --check tests/test_audio_processing_track.py clean

🤖 Generated with Claude Code

After PR #1001 ("Delay A/V in WebRTC until both tracks have been
seen."), AudioProcessingTrack.recv() now blocks in
_wait_for_initial_audio() on its first call until enough audio has
been buffered. Three tests still constructed tracks with
started=False and fed no/insufficient/paused audio, so recv() looped
forever, causing CI runs to time out at ~2h.

Drop started=False from the silence-fallback tests so they exercise
the post-anchor path, which is what these assertions actually cover.

Local pytest now completes in ~70s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Rafał Leszko <rafal@livepeer.org>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9949414f-ee39-40d6-aa23-ddf49048fc22

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rafal/fix-audio-track-test-hangs

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@leszko leszko merged commit 68b0f95 into main Apr 30, 2026
8 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 fal.ai Preview Deployment

Commit a8b751f
App ID daydream/scope-livepeer-pr-1022--preview
WebSocket wss://fal.run/daydream/scope-livepeer-pr-1022--preview/ws

Testing on Cloud

SCOPE_CLOUD_APP_ID="daydream/scope-livepeer-pr-1022--preview/ws" uv run daydream-scope

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