Skip to content

test(audio): count only the test thread's sleeps in the AudioMixer wait tests (869fbyjzx) - #30

Merged
ibiltari merged 1 commit into
rc_1from
fix/869fbyjzx-test-sleep-thread-noise
Oct 8, 2026
Merged

ibiltari merged 1 commit into
rc_1from
fix/869fbyjzx-test-sleep-thread-noise

Conversation

@ibiltari

@ibiltari ibiltari commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

tests/test_players_audiomixer.py patched time.sleep process-wide in seven tests and counted every call. Under pytest-xdist, threads left running by other tests in the same worker sleep through that patch too. On #25's CI run, after its branch was updated to current rc_1, TestSharedBudget::test_total_wait_stays_within_the_ceiling[6-0.2-10] saw 6083 s of foreign sleeps against a 1 s ceiling (run 37822438513). The production wait is correct. The test was measuring other threads.

_this_thread_sleeps() records only calls made by the test's own thread. Foreign calls are still swallowed, as before. A guard test runs a foreign sleeping thread inside the patch.

Changelog Line

Fixed: AudioMixer wait tests no longer count other tests' threads, which made CI fail intermittently.

Contribution Tier

  • Tier 1 — Trivial: test-only, no src/cuemsengine/ change.

Tests & Lint

  • tests/test_players_audiomixer.py: 114 passed (local iteration).
  • black and isort clean. flake8 only reports the file's two old unused imports; CI runs flake8 on src/ only.
  • CI green on this PR (pending).

Notes for Reviewers

This unblocks #25. The same test exists on the rc5 line (hotfix/rc5-6-orphan-kill, released as 0.1.0rc5-6); it does not affect the shipped deb.

…it tests (869fbyjzx)

Seven tests patched time.sleep process-wide and counted every call. Under
pytest-xdist, threads left running by other tests in the same worker sleep
through that patch too: on PR #25's CI run the shared-budget check saw 6083 s
of foreign sleeps against a 1 s ceiling. _this_thread_sleeps() records only
the calls made by the test's own thread (foreign calls are still swallowed),
with a guard test. Test-only change.
@ibiltari
ibiltari requested a review from backenv as a code owner October 8, 2026 18:16
@ibiltari
ibiltari merged commit 68af3d1 into rc_1 Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant