Skip to content

test(daemon-app): yield in the terminal-job wait like every sibling helper - #1307

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

test(daemon-app): yield in the terminal-job wait like every sibling helper#1307
DeusData merged 1 commit into
mainfrom
test/daemon-app-wait-yield

Conversation

@DeusData

Copy link
Copy Markdown
Owner

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_subscribers is the only one of the eight app_wait_for_* helpers that busy-spins without cbm_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.

…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>
@DeusData
DeusData merged commit 0abd5c6 into main Jul 27, 2026
8 checks passed
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>
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