test(daemon-app): yield in the terminal-job wait like every sibling helper - #1307
Merged
Conversation
…elper app_wait_for_terminal_job_with_subscribers was the only app_wait_for_* helper polling without cbm_usleep(1000): a sleepless spin pins a core for up to 10s and can starve the daemon threads it is polling on scarce-CPU runners. Release run 30305464193 hit exactly this on windows-11-arm (test_daemon_application.c:2671 ASSERT(terminal_with_prior_subscribers)); the suite passes 47/47 locally with the yield in place. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
timothybrush
pushed a commit
to timothybrush/codebase-memory-mcp
that referenced
this pull request
Jul 27, 2026
…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 (DeusData#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.
Release run 30305464193 failed on windows-11-arm 1/2 with
test_daemon_application.c:2671 ASSERT(terminal_with_prior_subscribers). Root cause:app_wait_for_terminal_job_with_subscribersis the only one of the eightapp_wait_for_*helpers that busy-spins withoutcbm_usleep(1000)— the spin pins a core for up to 10s and can starve the daemon threads it polls on the 4-vCPU ARM runners. One-line fix matching the suite's own idiom; 47/47 locally. Unblocks v0.9.1-rc.1.