[Bugfix] Flaky suite failure: OpenAL-soft asserts during device teardown (snippets/253_Music.py) #400
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tests/snippets/253_Music.pyfails intermittently — roughly 1 run in 3 — after the snippet itself has completed successfully. Not a test-logic bug; a shutdown race in the system OpenAL library.Evidence
Failing run's captured output (
python3 run_tests.py snippets -v):SNIPPET_OKis the harness's success marker, so every assertion the snippet makes has already passed. The abort happens afterwards, inalc_cleanupat process teardown, and the resulting non-zero exit is whatrun_tests.pyscores as a failure.Observed 3 times across 6 consecutive
run_tests.py snippetsinvocations (passing and failing runs interleaved with no source changes between them).Notes
AL lib: (EE) alc_cleanup: 1 device not closedprints on every engine shutdown, including clean ones — the engine leaves an ALC device open at exit. That is the precondition; the assert is the intermittent consequence.LockListsassertingalthrd_successat teardown is a known class of race in that vintage.benchmark_logging_test(passes standalone, fails in-suite) — both are teardown-order artifacts rather than behavioural failures.Possible directions
alc_cleanuphas nothing left to race on — this would also silence the unconditional(EE)line, which currently trains everyone to ignore engine stderr.SNIPPET_OKabort as a non-failure in the runner — but that hides real teardown crashes, so (1) is much preferable.Related
Independently reproduced and quantified, and confirmed not caused by the frame-lock change in
1523533(#398).Direct invocation, 30 runs each, same box, back to back:
LockListsassertion abortsGameEngine.cpp(as atb77aeec)1523533)Statistically indistinguishable — ~37–40%, consistent with the "roughly 1 in 3" in the issue body. The abort is unaffected by the change, so it is pre-existing.
Two details worth recording:
SNIPPET_OK/ the snippet's own prints always appear before the abort. The failure is entirely inalc_cleanupat process teardown.AL lib: (EE) alc_cleanup: 1 device not closedline appears on all 60 runs, aborting or not. It is the precondition, not the symptom, exactly as the issue says — which supports resolution (1): close the ALC device explicitly at shutdown.Practical impact today: a full
run_tests.pyhas a ~40% chance of scoring one spurious failure on this snippet. Two consecutive full-suite runs during #398's verification happened to come up clean (625/625 and 624/624 with--exclude=packaging), so a green suite is not evidence the race is gone.