Skip to content

Commit 9b8e809

Browse files
leonxgerclaude
andcommitted
test: disable real audio in the headless test harness
The release gate (python3 -m tests.run --all) hung indefinitely in the gui sound tests: a looping ambient/search bed kept re-decoding via Qt-multimedia/ ffmpeg, flooding stderr with "mp3float: Could not update timestamps" and never converging. The harness forced QT_QPA_PLATFORM=offscreen but left real audio enabled, so headless runs drove actual audio hardware - flaky across interpreters/CI runners (it has also segfaulted on teardown). Default SSLAX_NO_AUDIO=1 alongside the offscreen platform. The sound engine logic is fully covered via the stubbed engine + monkeypatching, so no coverage is lost; the suite stays green (1035 passed, 0 failed) and is now deterministic for the local gate and CI. Opt back in with SSLAX_NO_AUDIO="". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 56f6abb commit 9b8e809

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/harness.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Test harness: headless bootstrap, save discovery, the result model and the
22
shared Context (lazy QApplication + cached MainWindow + per-save decode verdicts).
33
4-
Importing this module forces ``QT_QPA_PLATFORM=offscreen`` BEFORE any Qt import,
5-
so every section is headless-safe. Sections never construct a QApplication or load
6-
reference data themselves; they ask the Context for what they need.
4+
Importing this module forces ``QT_QPA_PLATFORM=offscreen`` and ``SSLAX_NO_AUDIO=1``
5+
BEFORE any Qt import, so every section is headless-safe. Sections never construct a
6+
QApplication or load reference data themselves; they ask the Context for what they need.
77
"""
88

99
import os
@@ -14,6 +14,13 @@
1414

1515
# Headless before anything imports PySide6. Must run at import time.
1616
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
17+
# Never drive REAL audio hardware from the test suite. Qt-multimedia/ffmpeg playback in
18+
# an offscreen/headless context is flaky across interpreters and CI runners - it has both
19+
# hung (a looping bed re-decoding forever, stalling the release gate) and segfaulted on
20+
# teardown. The sound ENGINE logic is covered via the stubbed engine + monkeypatching, so
21+
# disabling real playback loses no coverage while making the suite deterministic everywhere
22+
# (local gate AND CI). Opt back into real audio with SSLAX_NO_AUDIO="" if ever needed.
23+
os.environ.setdefault("SSLAX_NO_AUDIO", "1")
1724

1825
REPO_ROOT = Path(__file__).resolve().parent.parent
1926
if str(REPO_ROOT) not in sys.path:

0 commit comments

Comments
 (0)