diff options
author | Gireesh Punathil <gpunathi@in.ibm.com> | 2015-03-18 02:57:39 -0400 |
---|---|---|
committer | Michael Dawson <Michael_Dawson@ca.ibm.com> | 2015-03-31 15:02:17 -0700 |
commit | f3f4e282168d243610f8e0241d633ff941c9c260 (patch) | |
tree | 6e3d8cb5865306f9a4593d620c9dad650ca4dd68 | |
parent | 61fe1fe21ba281b05b90a632e2dad29eefb14a0a (diff) | |
download | node-new-f3f4e282168d243610f8e0241d633ff941c9c260.tar.gz |
test: make cluster tests more time tolerant
simple tests test-cluster-master-error.js, test-cluster-master-kill.js
fails in AIX with assertion failure indicating that the workers were
alive even after the master terminated. A 200ms leeway is provided for
the workers to actually terminate, but the isAlive check returns
true in both the cases.
In AIX, the workers were actually terminating, but they took more time
- as much as 800ms (normal) to 1000ms (in rare cases).
Based on a C test we ran, it is found that the exit routines in AIX
is a bit more longer than that in Linux. There are a number of cleanup
activities performed in exit() system call, and depending on when the
signal handlers are shutdown in that sequence, the process will be
deemed as dead or alive, from another process's perspective.
process.kill(pid) is used in the test case to check the liveliness of
the worker, and when the kill() call is issued, even if the target
process is in it's exit sequences, if the signal handlers are not shut
down, it will respond to external signals, causing those calls to pass.
This fix extends the additional timeout for all platforms
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: https://github.com/joyent/node/pull/9431
-rw-r--r-- | test/simple/test-cluster-master-error.js | 2 | ||||
-rw-r--r-- | test/simple/test-cluster-master-kill.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/simple/test-cluster-master-error.js b/test/simple/test-cluster-master-error.js index ee2ed9eb4e..3bb980431f 100644 --- a/test/simple/test-cluster-master-error.js +++ b/test/simple/test-cluster-master-error.js @@ -114,7 +114,7 @@ if (cluster.isWorker) { existMaster = !!code; // Give the workers time to shut down - setTimeout(checkWorkers, 200); + setTimeout(checkWorkers, 1000); function checkWorkers() { // When master is dead all workers should be dead to diff --git a/test/simple/test-cluster-master-kill.js b/test/simple/test-cluster-master-kill.js index 3625403903..46189696fb 100644 --- a/test/simple/test-cluster-master-kill.js +++ b/test/simple/test-cluster-master-kill.js @@ -82,7 +82,7 @@ if (cluster.isWorker) { // check worker process status setTimeout(function() { alive = isAlive(pid); - }, 200); + }, 1000); }); process.once('exit', function() { |