Skip to content

fix(test): charge tone grace only during playback - #6668

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/test-flakes-2/tone-grace
Oct 25, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/test-flakes-2/tone-grace

Conversation

@kixelated

@kixelated kixelated commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The browser interop tone check spent its 3 s grace while the player's audio ring was refilling. A later refill could therefore fail valid audio as silence or the wrong tone under CPU starvation.

Approach

Accumulate the grace from fresh page observations while the audio context is running and the player is unstalled. Buffering and suspension pause the counter; silent or incorrect rendered audio still exhausts it. Reject analyser residue during a stall and preserve the observation that failed for the wrong-tone diagnostic. The overall interaction deadline stays unchanged.

Choices: use the player's stalled state rather than RMS to decide when playback spends grace, so digital silence still fails promptly. Count cumulatively across refills rather than restarting the grace.

Impact

  • Public API: none. This changes only the private interop driver and its tests.
  • Wire: none.

Validation

  • Replayed the original failure with virtual time: it expired at 3 s while stalled inside a 20 s interaction budget.
  • Eight virtual-time tests cover refills, suspension, repeated observations, analyser residue, silence, codec and channel mismatches; they run in the normal JS test suite and the nightly browser harness.
  • just ci and quest check --base origin/main passed.
  • Eight concurrent real-browser cells restricted to two CPUs passed with the fixed driver. The unchanged baseline passed 7/8; its failure was rendered-video startup, so the virtual-time replay remains the direct reproduction of the grace defect.
  • Real Chromium interop passed the valid Opus/AAC, swapped-tone, denied-publisher and refused-session controls using cached native binaries.

Alternatives

A longer wall-clock deadline would still charge buffering and would slow the wrong-tone control. Resetting grace on each refill would let repeated stalls postpone a real failure indefinitely.

Follow-ups

An initial eight-run/two-CPU experiment hit an unrelated concurrent bun install linking race; the available main browser cells passed. No production behavior or dependency changes are included.

(Written by GPT-6)

kixelated and others added 2 commits October 24, 2026 11:01
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated kixelated changed the title The interop tone check charges its grace only for audible playback fix(test): charge tone grace only during playback Oct 24, 2026
@kixelated
kixelated marked this pull request as ready for review October 24, 2026 18:12
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d1c0049-1bbc-43f2-b56f-63bf651ec696
Commits

Reviewing files that changed from the base of the PR and between ad0d74c and 609af43.

Files selected for processing: 6
  • quest/m1/test-flakes-2/README.md
  • quest/m1/test-flakes-2/tone-grace.md
  • test/interop/clients/js/driver.ts
  • test/interop/clients/js/tone.test.ts
  • test/interop/clients/js/tone.ts
  • test/justfile
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T04:08:02.563947Z 609af43 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…2/tone-grace

# Conflicts:
#	quest/m1/interop-js-tone.md
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary:

  • Merged origin/main into the branch (no rebase) in 609af43. The only conflict was quest/m1/interop-js-tone.md, which main deleted in moq-dev/moq#6647 while this PR had only retargeted its link to tone grace; resolved by keeping the deletion. The PR's diff against main is unchanged otherwise.
  • just check and quest check --base origin/main pass locally; required CI is green.
  • Review: Codex thumbs-up, no findings.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 65ad65c Oct 25, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m1/test-flakes-2/tone-grace branch October 25, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant