{"success":true,"name":"async-spawn-stub-server-tests","description":"Use when a node --test hangs with exit 143/144 and the test spawns a child process against an HTTP stub server started in the same test file","category":"unitary","path":"unitary/async-spawn-stub-server-tests/SKILL.md","file":"SKILL.md","content":"---\nname: async-spawn-stub-server-tests\ndescription: Use when a node --test hangs with exit 143/144 and the test spawns a child process against an HTTP stub server started in the same test file\n---\n> Imported from [PRIVATE_HOST] `~/unitary/generated/agents/handoff/data/skills/developer/async-spawn-stub-server-tests`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n1. If a node:test spawns a CLI that calls a stub HTTP server living in the same test process, use async execFile, never spawnSync (the sync spawn blocks the event loop, the stub never answers and the test hangs until timeout).\n2. Wrap runs with `timeout 60 node --test <file>`.\n3. Prove the test with a mutation: change the URL param in the rail, expect red, restore.\n4. In this harness, `sleep N; cat file` is blocked; use run_in_background or a Monitor with an until-loop.\n\nLinked: S:test-driven-development (test-writing trap)\nLearned: 2026-10-13, handoff h_developer_202610132302_254b.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}