Repository navigation
Description
Problem
integration/oh-my-pi/capture-shutdown.test.ts supervises the real oh-my-pi child process with a hardcoded setTimeout(() => child.kill(), 30_000) and then asserts expect(exit).toBe(0). On a slow runner the kill lands first, the child dies of SIGTERM, and the assertion reports Expected: 0 / Received: 143 — a message that reads like a product failure and names no deadline, so the next reader goes looking for a hang that is not there.
Observed on the Windows job for docs/adapter-arch-banner head 20e5870 (a markdown-only change):
(fail) default capture respects real SDK shutdown: unanswered [31770.79ms]
(fail) default capture respects real SDK shutdown: request-timeout [30385.81ms]
37 pass 2 fail
Exit 143 is 128 + SIGTERM, and both durations sit just past the 30 000 ms watchdog. The same file and the same product code passed on windows-latest for feat/554-pi-adapter at d98a5d5 and again for this branch's next head c0cd924 (9/9, 18:57–19:07), so the test is nondeterministic on Windows rather than broken by anything in the change under test. The two scenarios that fail are the two that wait on the host entering the shutdown path, which is where launch overhead accumulates.
The scenario under suspicion is not the loose one: request-timeout configures captureRequestTimeoutMs: 500. The budget that is too tight is the test's own, and it is independent of the deadline the product is asked to honour.
Required
- Make the watchdog a consequence of the scenario instead of a constant: derive it from the scenario's configured request deadline plus a measured launch allowance, or lift it to the value the surrounding real-host integration tests already use.
- Make the failure self-describing. When the watchdog fires, the assertion message must say the child was killed after N ms by the test's own timer, not surface a bare exit code 143.
- Name the slowest scenario and its measured wall time on both platforms in the ticket, so the allowance is chosen rather than guessed.
Acceptance
The five default capture respects real SDK shutdown scenarios pass repeatedly on windows-latest — five consecutive runs of the job, not one — with no change to what each scenario asserts. Deliberately hanging the child inside a scenario still fails, and fails with a message that states the timer fired.
Non-goals
Not a request to loosen the assertions or to mark the file Windows-only. The scenarios are the only place the real SDK's shutdown grant is exercised end to end.
Activity