Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit f3f4e28

Browse files
gireeshpunathilmhdawson
authored andcommitted
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 <[email protected]> PR-URL: #9431
1 parent 61fe1fe commit f3f4e28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/simple/test-cluster-master-error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ if (cluster.isWorker) {
114114
existMaster = !!code;
115115

116116
// Give the workers time to shut down
117-
setTimeout(checkWorkers, 200);
117+
setTimeout(checkWorkers, 1000);
118118

119119
function checkWorkers() {
120120
// When master is dead all workers should be dead to

test/simple/test-cluster-master-kill.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if (cluster.isWorker) {
8282
// check worker process status
8383
setTimeout(function() {
8484
alive = isAlive(pid);
85-
}, 200);
85+
}, 1000);
8686
});
8787

8888
process.once('exit', function() {

0 commit comments

Comments
 (0)