Skip to content

Commit 506c7fd

Browse files
committed
test: fix infinite spawn cycle in stdio test
Fix parallel/test-stdio-closed introduced in commit b5f25a9 ("src: ensure that file descriptors 0-2 are valid") to not keep spawning child processes ad infinitum. The test spawns itself as a child process but a missing return statement made the child process spawn itself again, and again, and again. It went unnoticed for some time because the child process exits almost immediately afterwards, i.e. it didn't fill up the process table. The observable effect was an iojs process that was quietly consuming CPU cyles in the background with a PID that was constantly changing. Refs: #938 PR-URL: #948 Reviewed-By: Fedor Indutny <[email protected]>
1 parent 87e4bfd commit 506c7fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/parallel/test-stdio-closed.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if (process.argv[2] === 'child') {
1313
process.exit(42);
1414
});
1515
});
16+
return;
1617
}
1718

1819
// Run the script in a shell but close stdout and stderr.

0 commit comments

Comments
 (0)