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

test: avoid orphaned child on Windows abort test#65451
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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (fd5b135) to head (8ce0003).
⚠️ Report is 215 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.

@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

Landed in e68a93a

@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>
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