Skip to content

test(daemon-app): wait for the stable terminal state, not the draining window - #1309

Merged
DeusData merged 1 commit into
mainfrom
test/daemon-app-terminal-wait
Jul 27, 2026
Merged

test(daemon-app): wait for the stable terminal state, not the draining window#1309
DeusData merged 1 commit into
mainfrom
test/daemon-app-terminal-wait

Conversation

@DeusData

Copy link
Copy Markdown
Owner

Third and structural fix for the daemon_application_fresh_request_does_not_reuse_terminal_subscribed_job reds (release runs 30305464193, 30309182389 — arm and x64). The waited-for state 'terminal AND ≥N/2 subscribers' is transient by construction: publish sets terminal and releases the blocked subscribers in one locked step, so the window's width is pure thread-wakeup scheduling — busy-spin caught it by luck, the #1307 1ms yield sampled past it, no budget pins it.

Production's reuse guard is terminal-only (application_find_active_job_locked skips terminal jobs; subscriber counts are never consulted), and the test's downstream assertions catch a reuse in every interleaving. So: wait for the stable active_jobs == 0, drop the racy helper. 47/47 locally; ARM VM verification running in parallel. Unblocks v0.9.1-rc.1.

…g window

The fresh-request guard test waited for 'job terminal AND >= N/2 subscribers
still attached'. Publish flips terminal and releases the blocked prior
requests in the same locked step, so that conjunction is a transient window
whose width is thread-wakeup scheduling: the busy-spin caught it by luck,
a 1ms-yield poll (#1307) sampled past it on fast x64 runners, and no budget
can pin it (release runs 30305464193 and 30309182389 failed it from both
directions).

The production guard never consults subscriber counts —
application_find_active_job_locked skips any terminal job — and the test's
downstream assertions (starts==2, destroys==2, stale/fresh response
separation) catch a terminal-job reuse in every interleaving. So wait only
for the stable end-state (active jobs == 0) and drop the racy helper.
47/47 locally.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData
DeusData merged commit d90986b into main Jul 27, 2026
8 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