fix: resolve UE5 audio test race condition#28
Merged
AndrewAltimit merged 2 commits intomainfrom Feb 21, 2026
Merged
Conversation
The `unload_track_fires_callback` test was flaky due to shared global static atomics (`LAST_EVENT`, `LAST_TRACK`, `LAST_VALUE`) being raced by parallel test threads. One test's `reset_globals()` could clobber another test's callback values mid-assertion. Fix: add a `Mutex` to serialize all tests that use the shared callback globals via `init_backend()`. The guard is held for the test's lifetime, preventing interleaving. Also prefix unused `port` variable with `_`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini AI Code ReviewIssues (if any)(none) Previous Issues (for incremental reviews)(none) Suggestions (if any)(none) Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Codex AI Code ReviewIssues (if any)(none) Previous Issues (for incremental reviews)(none) Suggestions (if any)
Notes
Generated by Codex AI (gpt-5.3-codex). Supplementary to human reviews. |
Owner
Author
Review Response Agent (Iteration 1)Status: No changes needed Fixed Issues
Ignored Issues
Deferred to Human
Notes
The agent reviewed feedback but determined no code changes were required. |
Remove the entirely unused `let _port = 0;` binding rather than just suppressing the warning with an underscore prefix. The listener config constructs its own port value independently. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Previous Issues
Issues(none) Suggestions(none) Notes
Generated by Gemini AI (gemini-3.1-pro-preview). Supplementary to human reviews. |
Codex AI Incremental ReviewThis is an incremental review focusing on changes since the last review. Issues (if any)(none) Previous Issues (for incremental reviews)
Suggestions (if any)(none) Notes
Generated by Codex AI (gpt-5.3-codex). Supplementary to human reviews. |
Owner
Author
Review Response Agent (Iteration 2)Status: No changes needed Fixed Issues
Ignored Issues
Deferred to Human
Notes
The agent reviewed feedback but determined no code changes were required. |
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.
Summary
unload_track_fires_callbacktest that broke main CI by adding aMutexto serialize tests sharing global callback atomics (LAST_EVENT/LAST_TRACK/LAST_VALUE)port->_port) inoasis-apptestRoot Cause
The UE5 audio tests use
static AtomicU32globals written by anextern "C"callback. When Rust runs tests in parallel, one test'sreset_globals()can overwrite another's callback values between the action and the assertion. The failing assertion sawu32::MAX(reset sentinel) instead of6(TrackUnloaded).Fix
init_backend()now acquires aMutexguard that serializes all callback-dependent tests. The guard lives for the test's lifetime via destructuring:let (_guard, mut b) = init_backend();. Tests that don't use callbacks (e.g.default_state,has_audio_*) are unaffected.Test plan
cargo test -p oasis-backend-ue5 -- audio-- all 22 tests passcargo test --workspace-- full suite passescargo clippy --workspace -- -D warnings-- cleancargo fmt --all -- --check-- cleanGenerated with Claude Code