Skip to content

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

Open
PickBas wants to merge 1 commit into
nodejs:mainfrom
JaneaSystems:issue-58118-updated
Open

test: avoid orphaned child on Windows abort test#65451
PickBas wants to merge 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 the tests. labels Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (fd5b135) to head (8ce0003).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65451      +/-   ##
==========================================
+ Coverage   90.12%   90.14%   +0.01%     
==========================================
  Files         752      752              
  Lines      252325   252315      -10     
  Branches    47456    47454       -2     
==========================================
+ Hits       227407   227437      +30     
+ Misses      16217    16181      -36     
+ Partials     8701     8697       -4     

see 58 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants