test(TASK-050): wait on every expected marker before asserting hook counts

Hook processes are fire-and-forget: the binary's exit drain acknowledges
spawns only, so the STARTED writer can land after the terminal one. The
macro-bracketing tests waited only for the terminal marker and then
asserted STARTED's count immediately, flaking on Windows CI and loaded
Linux runners. The bounded wait now covers every expected marker before
the exact-count and absence assertions run; the probe script's scenario K
comment is corrected to state the spawn-ack-only contract it already
waits around.
This commit is contained in:
Dark-Alex-17 committed 2026-09-17 00:33:37 -06:00
1 parent ec66494e8f
commit 611900057c
2 files changed
+18 -11

No files matched your search

+3 -2
View File
@@ -654,8 +654,9 @@ echo "== Scenario K: global_hooks wildcard grammar (exact, <event>.*, *.<name>,
# two hooks named 'mark' and 'other'. Each sub-case runs the same
# `--agent wc-probe --macro probe` recipe in its own config dir with a
# different global_hooks whitelist, then asserts exactly which markers were
# admitted. The binary drains pending hooks before exiting, so post-exit
# waits only absorb filesystem latency.
# admitted. The binary's exit drain only acknowledges hook SPAWNS — the hook
# processes finish on their own after exit — so every expected marker gets
# its own wait_for before any absence check reads the log.
k_run() {
# $1 = label, $2 = marker log, $3.. = global_hooks entries (verbatim)
local label="$1" klog="$2"