test(daemon-app): wait for the stable terminal state, not the draining window - #1309
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third and structural fix for the
daemon_application_fresh_request_does_not_reuse_terminal_subscribed_jobreds (release runs 30305464193, 30309182389 — arm and x64). The waited-for state 'terminal AND ≥N/2 subscribers' is transient by construction: publish setsterminaland 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_lockedskips terminal jobs; subscriber counts are never consulted), and the test's downstream assertions catch a reuse in every interleaving. So: wait for the stableactive_jobs == 0, drop the racy helper. 47/47 locally; ARM VM verification running in parallel. Unblocks v0.9.1-rc.1.