Skip to content

bug: ci Format lane flakes on test_pulse_monitor_device β€” the pulse harness samples daemon liveness once at readinessΒ #2996

Closed

Description

@zackees

Summary

Format πŸ” / checks on a master push failed on
ci/test_pulse_monitor_device.py::test_a_daemon_that_exits_on_its_own_fails_the_test_with_its_log
(run at da9535c0, 2026-10-30):

FAIL: test_a_daemon_that_exits_on_its_own_fails_the_test_with_its_log
  File ".../ci/test_pulse_monitor_device.py", line 266
  AssertionError: 9 != 1 : daemon did not start: wireplumber

A later push run at 5abb2f19 was green, so it is a flake, not a regression β€” but it reds the
master gate for everyone while it lasts, and each occurrence costs the 10 s deadline of the stub
test binary (the failing run took 22.9 s instead of ~12 s).

Cause

test/cmocka/test_pulse_monitor_device.py::wait_for_server samples the daemon group's liveness
exactly twice: once per poll iteration, and once more right after pactl info answers. The
DAEMON_DIE=wireplumber stub exits immediately after it starts, and a process's exit is only
visible to Popen.poll() once it has been reaped, so the post-readiness check frequently samples
in the window where the daemon is still alive. The harness then returns True, runs the test
binary, and the binary waits its full 10 s deadline for a wireplumber.json that never appears β†’
daemon did not start: wireplumber, exit 9.

Reproduced on a Linux host with the same command the lane runs:

cd ci && python -m unittest test_pulse_monitor_device.PulseMonitorDeviceTest.test_a_daemon_that_exits_on_its_own_fails_the_test_with_its_log
Ran 1 test in 1.083s  OK
Ran 1 test in 11.124s FAILED (failures=1)
Ran 1 test in 1.091s  OK

Proposed fix

Watch the group for a short settle window after pactl first answers (SETTLE_ATTEMPTS * SETTLE_SLEEP = 1 s; an exit lands in milliseconds) and treat a daemon that dies in that window as
the same half-started graph the existing check rejects. A new case
test_a_daemon_that_dies_just_after_the_server_answers_is_caught pins it with
DAEMON_BOOT_DELAY="wireplumber=0.2": RED on master (11.1 s, the 10 s deadline path), GREEN with
the settle window (1.3 s), and the full module is green three times in a row (~18 s each, up from
~13 s).

This is the same class as #2972 (a daemon still starting when the harness stops it): the harness
assumes one observation at readiness is enough to decide the graph is up.

No user-visible change: CI harness only, no docs/features.md line.

Activity

  1. added
    bug
    on Oct 30, 2026
  2. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    Claiming: investigation

    Reproduced locally from the Format lane's own command (1.08 s OK, 11.12 s FAILED, 1.09 s OK on three consecutive runs), so the cause is confirmed rather than suspected: wait_for_server samples the daemon group a second time right after pactl info answers, and a daemon's exit is only visible to Popen.poll() once it has been reaped, so the DAEMON_DIE stub is still alive at that sample about half the time. The harness then runs the test binary, which burns its 10 s deadline and exits 9.

    The fix is already readied and red/green locally: a settle window after readiness, pinned by a new case with a 0.2 s boot delay (RED on master at 11.1 s, GREEN at 1.3 s), plus the constants pinned in test_the_module_exposes_the_shells_contract. One PR, no user-visible change.

  3. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    /ready

  4. added
    needs-investigation
    on Oct 30, 2026
  5. added
    ready
    and removed
    needs-investigation
    on Oct 30, 2026
  6. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    PR #2998 carries the fix: RED 652897f48 (module 1 of 12 failing, the new case 11.1 s = the 10 s deadline path), GREEN 9c8170173 (12/12 three times, new case 1.3 s). Format πŸ” / checks is green on the PR; Fast Gate and Rust Tier 2 are still running, auto-merge is on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions