Repository navigation
test(cmocka): anchor the group-hide program meter to the mix's clock (#838) - #3000
Merged
Merged
Conversation
…838) program_level() pinned its 400 ms window to the wall clock and then slept 1000 ms, so on a starved machine the window closed before the audio thread mixed anything and all four cases failed with "no program audio was mixed". Open the window on the first frame mixed after the request and close it after 400 ms of mixed audio, waiting on that clock with a bounded timeout. Every assertion and threshold stays.
zackees
force-pushed
the
test/838-group-hide-audio-window
branch
from
October 30, 2026 05:47
b40bb20 to
7709bbc
Compare
… sleep (#838) The window keeps its original anchors (the clock at the request, 400 ms long), so it measures the same audio as before. What changes is that program_level() waits for the mix to reach the window's end on the mix's own clock, bounded at 5 s, instead of sleeping 1000 ms and hoping the audio thread had run: a starved machine delays the measurement instead of emptying it. The first attempt anchored the window on the first frame that arrived; the mix's own buffering then put a finished 300 ms show transition inside the window (0.89 of the tone) and the 100-repeat run caught it at 14/100.
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.
What
test_group_hide_transition_audio'sprogram_level()pinned its measurement window to the wall clock and then slept a fixed 1000 ms. On a loaded machine the window closes before the audio thread has mixed anything, and all four cases fail withno program audio was mixed— a failure in the test's own meter, not in the code under test (#838, first seen 2026-10-15 on a shared host, reproduced withENABLE_RUST_LIBOBS=OFFtoo).Part 1 of the decided three-PR sequence on #838 (test-side determinism, per the maintainer's
Decided:comment).test_async_delay_audiolisten()andtest_vlc_playlist_gapfollow in their own PRs.How
The window keeps both of its original anchors — the clock at the request and 400 ms of mix — so it measures exactly the audio it measured before. Only the wait changes:
program_level()arms the meter, records how far the mix has got (last_ts), and waits for the mix to reach the window's end on the mix's own clock, bounded at 5 s, instead of sleeping 1000 ms and hoping the audio thread ran;raw_audio()remembers the newest timestamp it has mixed while the meter is armed.Every assertion and threshold is unchanged, including
no program audio was mixedwhen the mix never delivers. A starved machine now delays the measurement instead of emptying it.An earlier attempt on this branch opened the window on the first frame that arrived. The mix's own buffering then put a finished 300 ms show transition inside the window (
after showing the group again: program level 0.89 of the tone), which the 100-repeat run caught at 14/100 — that is why the anchors are unchanged.Evidence
Test-timing only: no product code, no public header, no other C test touched (
git show --statis this one file).Local Tier 2 harness,
uv run --no-project rust/tools/linux-validate/run.py --repeat 100 --tests test_group_hide_transition_audio, on a host at load average 34 (16 cores), so the fix is measured under exactly the starvation that produced the flake:No
***Failedline anywhere in the run;ENABLE_RUST_LIBOBS=OFFandONboth hold, and the unmodified 623-test suite still passes in both modes.PR CI: Fast Gate ✅, Tier 2 Linux build/tests OFF+ON ✅, CI Gate ✅.
Refs #838