fix: kill the whole process tree on Windows spawn-test timeout (#13) #50

Merged
the_og merged 1 commits from fix/13-windows-tree-kill into main 2026-07-12 13:31:15 -04:00
Owner

Closes #13.

  • Windows timeout kill now uses taskkill /PID <pid> /T /F via _kill_process_tree_windows()Popen.kill() only terminated the direct child, so runner-style commands (npxnode → server) leaked the real server process on every spawn test.
  • The spawned test process also gets CREATE_NO_WINDOW so the windowed exe doesn't flash a console window per Test launch / Test all.
  • Tests: a unit test pins the taskkill invocation; a Windows-only integration test spawns a parent-with-child and asserts (via tasklist) the child is dead after the spawn-test kill — this runs for real on the windows-latest CI job.

🤖 Generated with Claude Code

Closes #13. - Windows timeout kill now uses `taskkill /PID <pid> /T /F` via `_kill_process_tree_windows()` — `Popen.kill()` only terminated the direct child, so runner-style commands (`npx` → `node` → server) leaked the real server process on every spawn test. - The spawned test process also gets `CREATE_NO_WINDOW` so the windowed exe doesn't flash a console window per Test launch / Test all. - Tests: a unit test pins the taskkill invocation; a Windows-only integration test spawns a parent-with-child and asserts (via `tasklist`) the **child** is dead after the spawn-test kill — this runs for real on the windows-latest CI job. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
the_og added 1 commit 2026-07-12 13:30:14 -04:00
fix: kill the whole process tree on Windows spawn-test timeout (#13)
CI / Lint (ruff) (pull_request) Successful in 7s
CI / Tests (py3.10 / ubuntu-latest) (pull_request) Successful in 8s
CI / Tests (py3.12 / windows-latest) (pull_request) Successful in 20s
CI / Tests (py3.12 / ubuntu-latest) (pull_request) Successful in 9s
CI / Tests (py3.13 / ubuntu-latest) (pull_request) Successful in 8s
1384ed9703
Popen.kill() only terminated the direct child, so runner-style commands
(npx -> node -> server) leaked the real server process on every Windows
spawn test. taskkill /PID <pid> /T /F walks the descendant tree. Also
sets CREATE_NO_WINDOW on the spawned test process so the windowed exe
doesn't flash a console per test.

Closes #13

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
the_og merged commit ed7c40cac9 into main 2026-07-12 13:31:15 -04:00
the_og deleted branch fix/13-windows-tree-kill 2026-07-12 13:31:15 -04:00
Sign in to join this conversation.