mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 13:26:40 +00:00
test_script_killed_before_publishing_the_delegate_runs_no_update killed the hand-off script, slept a fixed 3 s and then asked tasklist whether the suspended update child was gone. The child dies through its job: the script held the only handle to a KILL_ON_JOB_CLOSE job, and the kernel terminates the members when the dying process's handle table is torn down. That termination is asynchronous to the script's own exit, so on a loaded Windows runner the 3 s guess loses and tasklist still lists the child. Open a SYNCHRONIZE handle on the child while it lives (which also pins the pid against reuse) and wait for it to be signalled, bounded at 60 s. The 'ran' check moves after the wait: once the child has exited it can never write the marker file, so the assertion is final instead of a snapshot.