From 71b5d80682e0db32f4888a33df9e0c83cea1c799 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 15 Sep 2015 17:54:20 -0400 Subject: [PATCH] test: make cluster tests more time tolerant Port https://github.com/nodejs/node-v0.x-archive/commit/f3f4e282168d243610f8e0241d633ff941c9c260 to master, updating to guard changes for AIX as requested PR-URL: https://github.com/nodejs/node/pull/2891 Reviewed-By: Rich Trott Reviewed-By: Jeremiah Senkpiel --- test/parallel/test-cluster-master-error.js | 7 ++++++- test/parallel/test-cluster-master-kill.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-cluster-master-error.js b/test/parallel/test-cluster-master-error.js index e729963d7df6a9..ae0f655bb8e5d0 100644 --- a/test/parallel/test-cluster-master-error.js +++ b/test/parallel/test-cluster-master-error.js @@ -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 diff --git a/test/parallel/test-cluster-master-kill.js b/test/parallel/test-cluster-master-kill.js index 89694ffd115bb4..32f22b0f968b7b 100644 --- a/test/parallel/test-cluster-master-kill.js +++ b/test/parallel/test-cluster-master-kill.js @@ -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() {