mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
669 B
34 lines
669 B
15 years ago
|
process.mixin(require("../common"));
|
||
16 years ago
|
|
||
|
var N = 40;
|
||
|
var finished = false;
|
||
|
|
||
|
function spawn (i) {
|
||
15 years ago
|
var child = process.createChildProcess( 'python'
|
||
15 years ago
|
, ['-c', 'print 500 * 1024 * "C"']
|
||
|
);
|
||
16 years ago
|
var output = "";
|
||
|
|
||
15 years ago
|
child.addListener("output", function(chunk) {
|
||
16 years ago
|
if (chunk) output += chunk;
|
||
15 years ago
|
});
|
||
16 years ago
|
|
||
15 years ago
|
child.addListener("error", function(chunk) {
|
||
|
if (chunk) error(chunk)
|
||
|
});
|
||
|
|
||
15 years ago
|
child.addListener("exit", function () {
|
||
15 years ago
|
puts(output);
|
||
16 years ago
|
if (i < N)
|
||
|
spawn(i+1);
|
||
|
else
|
||
|
finished = true;
|
||
16 years ago
|
});
|
||
16 years ago
|
}
|
||
|
|
||
15 years ago
|
spawn(0);
|
||
16 years ago
|
|
||
15 years ago
|
process.addListener("exit", function () {
|
||
15 years ago
|
assert.equal(true, finished);
|
||
15 years ago
|
});
|