Skip to content

Commit

Permalink
test: make cluster tests more time tolerant
Browse files Browse the repository at this point in the history
Port nodejs/node-v0.x-archive@f3f4e28
to master, updating to guard changes for AIX as requested

PR-URL: #2891
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
mhdawson authored and Fishrock123 committed Sep 20, 2015
1 parent 3e09dcf commit 71b5d80
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion test/parallel/test-cluster-master-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ if (cluster.isWorker) {
existMaster = !!code;

// 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() {
// When master is dead all workers should be dead to
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-cluster-master-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ if (cluster.isWorker) {
assert.equal(code, 0);

// check worker process status
var timeout = 200;
if (common.isAix) {
// AIX needs more time due to default exit performance
timeout = 1000;
}
setTimeout(function() {
alive = isAlive(pid);
}, 200);
}, timeout);
});

process.once('exit', function() {
Expand Down

0 comments on commit 71b5d80

Please sign in to comment.