Repository navigation
test(mediaplayer): align bridge timing slack with the re-sync threshold - #991
Merged
Merged
Conversation
The stall and file-switch tests allowed 150 ms of lateness, while the bridge itself lets a buffer run up to LATE_RESYNC_NS (250 ms) late before it re-syncs. On the loaded macOS CI runner buffers land 150-240 ms late, so both tests failed on nearly every macOS run. Take the slack from LATE_RESYNC_NS plus 50 ms for the hop, lengthen the stall to 800 ms so a removed re-sync still fails by a wide margin, and pace the pushes on absolute deadlines so sleep overruns do not add up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
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.
Refs #957
Problem
a_live_timeline_with_a_stall_plays_on_time_in_the_main_pipelineandplayback_carries_on_in_time_after_a_file_switchfail on nearly every macOS CI run. I scanned ~30 failed runs on main and PRs: every Build (macOS) failure was one or both of them, always with "arrived N ms after its time", where N was 150–240 ms (once 395 ms). Every green run I checked had skipped the macOS job.There are two causes, both in the tests:
LATE_RESYNC_NS(250 ms) late. Lateness between 150 and 250 ms is allowed by design, and the tests treated it as a failure.sleep(20ms)calls, so sleep overruns on a loaded runner added up. The failing buffer was often from before the stall (e.g. buffer 6).Change
Test-only change:
SLACK_NS = timing::LATE_RESYNC_NS + 50 msin both tests: what the bridge allows, plus a margin for the hop through the main pipeline.Rejected:
#[serial]: it only serializes against other#[serial]tests, and the rest of the suite still runs in parallel.Evidence
Timing::placeto never re-sync and the test failed withbuffer 15 arrived 705 ms after its time in the main pipeline.ci:macosrun on this PR finishes.Tests
Ran (macOS, local):
cargo test --lib mediaplayer::bridge::tests, 13 passed.cargo fmt --checkandcargo clippy --all-targetsare clean.Not run: the full suite locally. The macOS and Windows CI jobs run through the
ci:macoslabel.Out of scope
The tests are still wall-clock based. If the runner stalls the test's own measurement for more than ~300 ms, they can still fail.
🤖 Generated with Claude Code