microsoft / microsoft/vscode-azureresourcegroups
Generated smoke script never exits on Windows: `proc.kill()` leaves the `func` host alive
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 78
- Forks
- 55
- Avg merge
- 16h 49m
- Merged PRs (30d)
- 139
Description
Found while running a real end-to-end Create New Project with Copilot project. The generated scripts/smoke-backend.mjs completes its tests in ~20 seconds and then hangs forever on Windows.
Reproduction
Generate a Node/Azure Functions project through the flow, then from the workspace root:
node scripts/smoke-backend.mjs
Observed:
[smoke] smoke summary: 12 passed, 0 failed ← printed at ~20s
…and the process never exits. Measured 47 minutes later: the node process was still alive with 10 seconds of total CPU — blocked, not working — and an orphaned func process still held port 7071.
Cause
teardown() calls proc.kill() on the child it spawned. On Windows func is a .cmd wrapper, so this kills the wrapper and leaves the real Functions host running. That orphan keeps the inherited stdio pipe open, so node's event loop never drains and the process cannot exit.
The tests themselves are fine — all 12 assertions pass, including GET /api/tasks (no auth) → 401.
Why it matters
- CI or any script that shells out to the smoke test hangs rather than failing, which is the worst failure shape: it burns the whole job timeout and produces no signal.
- It's invisible on Linux, so it won't be caught by a Linux-only pipeline.
- Anyone piping the output through a buffering consumer sees nothing at all until the timeout — I lost ~50 minutes to exactly that before redirecting to a file.
Suggested fix
Kill the process tree rather than the immediate child — taskkill /T /F /PID on Windows, or spawn into a job object. The same applies anywhere else a generated script spawns func, vite or another .cmd-wrapped tool and later tears it down.
Notes
- No agent instruction prescribes this teardown pattern;
git grep "proc.kill\|\.kill()" -- resources/agents/returns nothing, so the agent invented it. A worked teardown snippet in the shared references would fix it at the source for every generated project. - No eval gate currently covers the generated smoke scripts, so this would not have been caught by the harness either.
Environment: Windows 11, Node v24.19.0, Azure Functions Core Tools 4.14.0, Docker Desktop 29.7.2.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run node scripts/smoke-backend.mjs on Windows and inspect its teardown logic, then review the related agent guidance under resources/agents and the shared references mentioned in the issue. Done means the generated smoke script exits after its 12 passing assertions, without leaving an orphaned func process or open stdio pipe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, node.js, typescript
- Domain
- cloud, devops, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100