aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-stdio-closed.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-02-25 10:40:33 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2015-02-25 11:13:03 +0100
commit506c7fd40b5d9fbdc965e1e2da948589ec3ca246 (patch)
treed40eca1ffd08f9d84fa48b938c0804b69df0b3a7 /test/parallel/test-stdio-closed.js
parent87e4bfd58216b1a1a3fa5bb957550e1d44695fdb (diff)
downloadandroid-node-v8-506c7fd40b5d9fbdc965e1e2da948589ec3ca246.tar.gz
android-node-v8-506c7fd40b5d9fbdc965e1e2da948589ec3ca246.tar.bz2
android-node-v8-506c7fd40b5d9fbdc965e1e2da948589ec3ca246.zip
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: https://github.com/iojs/io.js/pull/938 PR-URL: https://github.com/iojs/io.js/pull/948 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'test/parallel/test-stdio-closed.js')
-rw-r--r--test/parallel/test-stdio-closed.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/parallel/test-stdio-closed.js b/test/parallel/test-stdio-closed.js
index fd081b8c11..2543d8b021 100644
--- a/test/parallel/test-stdio-closed.js
+++ b/test/parallel/test-stdio-closed.js
@@ -13,6 +13,7 @@ if (process.argv[2] === 'child') {
process.exit(42);
});
});
+ return;
}
// Run the script in a shell but close stdout and stderr.