Skip to content

fix(ci): watch the pulse daemon group past readiness, not once at it (#2996) - #2998

Merged
zackees merged 2 commits into
masterfrom
infra/2996-pulse-daemon-settle
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/2996-pulse-daemon-settle

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

Format 🔍 / checks reds on a master push when the pulse harness samples the daemon group a fraction too early. Fixes #2996.

Cause

wait_for_server samples liveness twice — once per poll, once right after pactl info answers — and neither sample waits. The DAEMON_DIE stub exits at once, and a process's exit is only visible to Popen.poll() once it has been reaped, so the post-readiness sample sees it alive about half the time. The harness then runs the test binary, which waits its full 10 s deadline for a wireplumber.json that never appears and exits 9 (daemon did not start: wireplumber) instead of the harness's own 1 (wireplumber exited on its own:).

Same class as #2972: one observation at readiness is not enough to decide the graph is up, as this run's own stub const doubles as a daemon that exits just after pactl answers.

RED — 652897f48

test_a_daemon_that_dies_just_after_the_server_answers_is_caught uses DAEMON_BOOT_DELAY="wireplumber=0.2" so the daemon is up at readiness and gone 0.2 s later, which is what a flaky runner produces on its own. Against the unchanged harness the whole module fails exactly once:

Ran 12 tests in 24.614s
FAILED (failures=1)

and that case alone takes 11.1 s — the stub test binary's 10 s deadline, i.e. the wrong failure path.

GREEN — 9c8170173

_dead_after_settling() watches the group for SETTLE_ATTEMPTS * SETTLE_SLEEP = 1 s after the server first answers, returning False from wait_for_server the moment a daemon is gone. The instant-DAEMON_DIE case (the flake seen on master at da9535c0) is caught by the same window.

Ran 12 tests in 17.304s OK
Ran 12 tests in 17.650s OK
Ran 12 tests in 17.990s OK      # three consecutive runs
Ran 1 test  in  1.289s OK       # the new case, GREEN

test_the_module_exposes_the_shells_contract pins the two constants, so the window cannot silently shrink to zero.

Notes

  • No user-visible change: CI harness only, no docs/features.md line.
  • The lane's own test_check_changes.py::test_outputs_are_written_to_the_step_file errors in this checkout with git: command not found (the test's stub PATH has no git here); it is untouched by this PR and is the only other failure in uv run ci/local_gate.py --lane lint.
  • The claim bot had not picked up the Claiming: investigation / /ready comments on bug: ci Format lane flakes on test_pulse_monitor_device — the pulse harness samples daemon liveness once at readiness #2996 when this was pushed (its scheduled run is ~3-hourly); the issue is self-filed and small, so the PR carries the evidence.

@zackees
zackees enabled auto-merge October 30, 2026 04:55
@zackees

zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

State: Format 🔍 / checks (the lane this fixes) green, CI Mode, Event Data, Validate Data green; Fast Gate ⚡ and Rust Tier 2 Linux 🐧 still running (the test/cmocka wrapper change selects them, though no C changes). Auto-merge is on, so it queues when they land.

Local evidence, quoted in the body: RED 652897f48 = 1 of 12 failing (24.6 s module, 11.1 s on the case alone = the stub's 10 s deadline path); GREEN 9c8170173 = 12/12 three times in a row (~18 s), the new case 1.3 s. uv run ci/local_gate.py --lane lint has one unrelated failure here: test_check_changes.py::test_outputs_are_written_to_the_step_file raises git: command not found from its stub PATH — untouched by this PR, and the same suite passes in CI.

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review: LGTM. RED (12 tests, 1 failure, new case hitting the 10 s wrong path) → GREEN (3 clean runs); the 1 s settle window is pinned by the contract test so it cannot shrink to zero, and it only adds 1 s on the success path. The edit is the Python harness under test/cmocka/, not a C test, so the no-edit rule is untouched. No ledger line needed. Queue on green.

@zackees
zackees added this pull request to the merge queue Oct 30, 2026
Merged via the queue into master with commit bcc998a Oct 30, 2026
40 checks passed
@zackees
zackees deleted the infra/2996-pulse-daemon-settle branch October 30, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: ci Format lane flakes on test_pulse_monitor_device — the pulse harness samples daemon liveness once at readiness

1 participant