test: make cluster tests more time tolerant
Port f3f4e28216
to master, updating to guard changes for AIX as requested
PR-URL: https://github.com/nodejs/node/pull/2891
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
1cfee8ebcb
commit
2853f9894f
@ -93,7 +93,12 @@ if (cluster.isWorker) {
|
|||||||
existMaster = !!code;
|
existMaster = !!code;
|
||||||
|
|
||||||
// Give the workers time to shut down
|
// Give the workers time to shut down
|
||||||
setTimeout(checkWorkers, 200);
|
var timeout = 200;
|
||||||
|
if (common.isAix) {
|
||||||
|
// AIX needs more time due to default exit performance
|
||||||
|
timeout = 1000;
|
||||||
|
}
|
||||||
|
setTimeout(checkWorkers, timeout);
|
||||||
|
|
||||||
function checkWorkers() {
|
function checkWorkers() {
|
||||||
// When master is dead all workers should be dead to
|
// When master is dead all workers should be dead to
|
||||||
|
@ -59,9 +59,14 @@ if (cluster.isWorker) {
|
|||||||
assert.equal(code, 0);
|
assert.equal(code, 0);
|
||||||
|
|
||||||
// check worker process status
|
// check worker process status
|
||||||
|
var timeout = 200;
|
||||||
|
if (common.isAix) {
|
||||||
|
// AIX needs more time due to default exit performance
|
||||||
|
timeout = 1000;
|
||||||
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
alive = isAlive(pid);
|
alive = isAlive(pid);
|
||||||
}, 200);
|
}, timeout);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.once('exit', function() {
|
process.once('exit', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user