session-description-handler.spec.ts: Fix flaky NotReadableError - #1128
Open
23Skidoo wants to merge 1 commit into
Open
session-description-handler.spec.ts: Fix flaky NotReadableError#112823Skidoo wants to merge 1 commit into
23Skidoo wants to merge 1 commit into
Conversation
Chrome coalesces getUserMedia calls for one device onto a shared device session. Every spec boundary in this file stops all tracks, dropping the session's consumer count to zero and starting an asynchronous teardown in the audio service; the next spec's getUserMedia is then occasionally told the device is already open and joins the dying session, failing with NotReadableError: Could not start audio source. Which spec fails depends on where the race lands, so it presents as an intermittent failure scattered across the interop tests, more frequent on loaded machines. A single audio track acquired for the file's whole run keeps the consumer count above zero, so no teardown ever races a join. Ten consecutive runs in an environment reproducing the failure on roughly two in five runs came back clean.
23Skidoo
marked this pull request as ready for review
August 26, 2026 05:46
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.
The Web SessionDescriptionHandler interop specs fail intermittently with
NotReadableError: Could not start audio source, landing on a different spec each time and more often on loaded machines.Chrome coalesces
getUserMediacalls for one device onto a shared device session. Every spec boundary in this file stops all tracks, dropping the session's consumer count to zero and starting an asynchronous teardown in the audio service. The next spec'sgetUserMediais then occasionally told the device is already open and joins the dying session; the track start lands inside the teardown and fails. Chrome's verbose log shows the close and the failure on the same session id, 1.4ms apart:A single audio track acquired in
beforeAlland released inafterAllkeeps the consumer count above zero for the file's whole run, so no teardown ever races a join. In an environment reproducing the failure on roughly two runs in five, ten consecutive runs with this change came back clean.This contribution was prepared with LLM assistance (Claude): the investigation, the change, and this description. A human reviewed it and stands behind the submission.