mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Add failing test. Process spawning loop.
I think this is the issue Felix Geisendoerfer is reporting: http://groups.google.com/group/nodejs/browse_thread/thread/efbae1ec1e67786c
This commit is contained in:
29
test/mjsunit/test-process-spawn-loop.js
Normal file
29
test/mjsunit/test-process-spawn-loop.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
include("mjsunit.js");
|
||||||
|
|
||||||
|
var N = 40;
|
||||||
|
var finished = false;
|
||||||
|
|
||||||
|
function spawn (i) {
|
||||||
|
var p = new node.Process('python -c "print 500 * 1024 * \'C\'"');
|
||||||
|
var output = "";
|
||||||
|
|
||||||
|
p.onOutput = function(chunk) {
|
||||||
|
if (chunk) output += chunk;
|
||||||
|
};
|
||||||
|
|
||||||
|
p.onExit = function () {
|
||||||
|
//puts(output);
|
||||||
|
if (i < N)
|
||||||
|
spawn(i+1);
|
||||||
|
else
|
||||||
|
finished = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLoad () {
|
||||||
|
spawn(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onExit () {
|
||||||
|
assertTrue(finished);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user