Repository navigation
test: Keep the audio thread out of test_audio_clock_drift - #3587
Merged
Merged
Conversation
The audio thread discards from every source on its list, also one that is removed from the mix. The first stamp maps to the real clock, so a stall in the first packets left the buffer behind that clock, a tick consumed it and the test counted a dropout. Park the audio thread in a task while the test owns the buffer, and drop the test from the asan known list. Fixes #3576 Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=9dfdd2a172a8e8fb50ac65ff9e28d1498d644013 secs=280 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1793734590,"gate":"rust/all/fmt","host":"linux-x86_64","key":"f9e916798e8b96bfce077362596f36b019835341205806f8d490f250d005e8e0","lane":"lint","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":36,"stamp":"5716a781a9f5959239bad2d670681cef","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"f9e916798e8b96bfce077362596f36b019835341205806f8d490f250d005e8e0","lane":"lint","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":36,"stamp":"a90266c5cd1345fdc9a6c713682595ff","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"bf330e0c1be0e1cf5e9fc4a1831d8ebf4053acc6fa9c1761c46046388345ab7a","lane":"rust-test","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":83,"stamp":"5c8778abc2bf1d6c5b1139bd0845a83e","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"e1f3fb2e30da5d060a838f118f48a361ebd31b5f9ceec6666265887cb2130802","lane":"cross","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":40,"stamp":"4b216074bb25af6df4e8e8af88177ed5","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"e1f3fb2e30da5d060a838f118f48a361ebd31b5f9ceec6666265887cb2130802","lane":"cross","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":40,"stamp":"9e7d22a9e13e5b23f406d57e5a18228d","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"e1f3fb2e30da5d060a838f118f48a361ebd31b5f9ceec6666265887cb2130802","lane":"cross","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":40,"stamp":"2f3ad7103f9f4130bd9c3564f4ee1f63","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"e1f3fb2e30da5d060a838f118f48a361ebd31b5f9ceec6666265887cb2130802","lane":"cross","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":40,"stamp":"baefd63288ea205e30b6ec2421e523f0","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"} Ci-Attestation: {"at":1793734590,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"a9a90824a988d6db007dd39dbdad8cde456134d00bbc80af33f965cd506a7a92","lane":"tier2-linux","parents":["8c414e5426cd126e07889ad9a3bf3243d9f0d386"],"secs":280,"stamp":"82b6eee424cd6a6581d3453c99ea5a8f","tree":"9dfdd2a172a8e8fb50ac65ff9e28d1498d644013","v":1,"via":"run"}
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 changed
test_audio_clock_driftnow parks the audio thread in anOBS_TASK_AUDIOtask while it owns the source's buffer, and resumes it before it releases the source. The test leaves the asan known list, andKNOWN_ENTRIESgoes from 6 to 5.Cause
The audio thread's
discard_audio()runs on every source on its list, also one that is removed from the mix. The test's first stamp maps to the real clock, and only later packets move ahead of it. A stall in the first packets leaves the buffer behind the real clock, so a tick consumes from it, and the test counts a dropout.This is a test bug. For a real source, discarding audio that is behind is the expected behavior.
RED and GREEN
I added a stall at packet 3 of
slow_device_clock_has_no_dropouts. I did not commit it. These runs use a TSan build with reports off.The failure on #3563 had the same shape: 1 dropout, 0 clicks. All 6 cases pass with the fix and no stall.
Test cost: no new test. The test adds no running threads: it parks the existing audio thread. Its run time is not measured separately, but the fix adds no wait beyond the task hand-off.
Fixes #3576
🤖 Generated with Claude Code