Skip to content

Fix two macOS flakes: sound level and stalled-receiver tests - #124

Merged
AlxcBTW merged 1 commit into
mainfrom
fix/macos-flakes
Oct 27, 2026
Merged

AlxcBTW merged 1 commit into
mainfrom
fix/macos-flakes

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Two flaky tests that fail on the macOS runner and turn unrelated PRs red (#110-#112).

Causes

the_streamer_s_sound_is_played_by_the_viewer (sound.rs): asserted that the single highest played sample is below 0.35 (tone peak 0.25). Opus overshoots on the first packets and where a late packet is concealed or rebuilt, and a slow shared runner stalls the pipeline often enough to hit that (seen: peak 0.388). The test now checks what it is meant to prove, the level of the tone: the 90th percentile of the audible samples (expected 0.247) must lie in 0.2..0.28, and no sample may reach 0.5 (about double gain). Not a retry, and a wrong gain, silence or garbage still fails.

a_stalled_receiver_costs_a_bounded_queue_not_a_task_per_packet (traffic.rs): expected at least one expired packet after 10 000 sends and 1.5 s. The sender only stalls once the connection's stream limit/windows are used up, and how many of the 10 000 packets reach the queue depends on how the sender task and the send loop interleave. On a slow runner the sender keeps up with the burst, never stalls, nothing expires (log: tasks 15/15/15, expired == 0). The test now keeps feeding paced batches until a queued packet expires (up to 20 s), checks the task bound all the while, then waits the 1.5 s as before. The thing proven is unchanged: bounded queue, no task per packet, expiry on a stalled receiver.

Failure rates before (last 100 runs of ci, job check (macos-latest), 50 runs)

  • 20 of 50 failed (40 %).
  • the_streamer_s_sound_is_played_by_the_viewer: 8 (16 %).
  • a_stalled_receiver_... : seen in run 40495192564 (not in the window counted).
  • Other macOS failures, not touched here: real_window::the_worker_saves_a_clip_of_a_real_window (share-worker access.rs) 3, share_play.rs:103 (a_game_that_goes_away_ends_the_share, hand_over_...) 2, tunnel.rs:451 1, clippy errors on unmerged heads 3 (and 1 other not compiled).

Stability

macOS job rerun results are listed in a comment below.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@AlxcBTW

AlxcBTW commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Stability: the macOS jobs (check and devices) of the final head were rerun 3 more times after the first green run: 4 of 4 green for both. (Devices once failed before on tunnel.rs:451 and play.rs, both unrelated and green on rerun.)

@AlxcBTW
AlxcBTW merged commit b3a3b54 into main Oct 27, 2026
33 of 35 checks passed
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