test: make cluster tests more time tolerant
authorMichael Dawson <michael_dawson@ca.ibm.com>
Tue, 15 Sep 2015 21:54:20 +0000 (17:54 -0400)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Sun, 20 Sep 2015 17:30:52 +0000 (10:30 -0700)
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 <rtrott@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
test/parallel/test-cluster-master-error.js
test/parallel/test-cluster-master-kill.js

index e729963..ae0f655 100644 (file)
@@ -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
index 89694ff..32f22b0 100644 (file)
@@ -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() {