test: avoid orphaned child on Windows abort test by PickBas · Pull Request #65451 · nodejs/node · GitHub
Skip to content

test: avoid orphaned child on Windows abort test - #65451

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
JaneaSystems:issue-58118-updated
Aug 31, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
JaneaSystems:issue-58118-updated

Conversation

@PickBas

@PickBas PickBas commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

On Windows, test-child-process-exec-abortcontroller-promisified can leave stray node.exe processes behind after the test exits.

exec() runs the command through cmd.exe, and cmd.exe cannot replace itself with the command it runs, so the node.exe started for -e "setInterval(()=>{}, 99)" is a grandchild. child.kill() terminates only the direct child, leaving that grandchild orphaned if the kill lands after cmd.exe has already created it. This is timing-dependent and does not reproduce on every machine.

Fix

Use the cmd.exe builtin pause as the wait command. It blocks on the stdin pipe that exec() opens and spawns no process of its own, so cmd.exe is the only process in the tree and killing it leaves nothing behind.

Fixes: #58118

Fixes: nodejs#58118
Signed-off-by: PickBas <sayed.kirill@gmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 27, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 27, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@StefanStojanovic StefanStojanovic added the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 31, 2026
@nodejs-github-bot
nodejs-github-bot merged commit e68a93a into nodejs:main Aug 31, 2026
81 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 31, 2026
aduh95 pushed a commit that referenced this pull request Sep 3, 2026
Fixes: #58118
Signed-off-by: PickBas <sayed.kirill@gmail.com>
PR-URL: #65451
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
R31K4G3 pushed a commit to R31K4G3/node that referenced this pull request Sep 9, 2026
Fixes: nodejs#58118
Signed-off-by: PickBas <sayed.kirill@gmail.com>
PR-URL: nodejs#65451
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
aduh95 pushed a commit that referenced this pull request Sep 9, 2026
Fixes: #58118
Signed-off-by: PickBas <sayed.kirill@gmail.com>
PR-URL: #65451
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
aduh95 pushed a commit that referenced this pull request Sep 9, 2026
Fixes: #58118
Signed-off-by: PickBas <sayed.kirill@gmail.com>
PR-URL: #65451
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leftovers after test-child-process-exec-abortcontroller-promisified

4 participants