summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGireesh Punathil <gpunathi@in.ibm.com>2015-03-26 04:31:14 -0400
committerMichael Dawson <Michael_Dawson@ca.ibm.com>2015-04-01 12:26:04 -0700
commit66b243dd87509a7e259bf9bfec1ab31e01620b3e (patch)
treebe7182342528e1f566617f4abb2dd6e1b14994fb
parentc657dac5d5c1db43793d9a523dba332dba1cd509 (diff)
downloadnode-new-66b243dd87509a7e259bf9bfec1ab31e01620b3e.tar.gz
test: relax the timing window in test-child-process-fork-net2.js
In Linux, simple/test-child-process-fork-net2.js fails intermittently. In SuSE Linux system, under network high load situations, this failure is consistently reproducible. The test case tests whether the TCP connections which were established between the processes terminate in a timely and clean manner. After some iterations of data transfer on established connections, the server is closed. The server does not get closed immediately, instead waits for all the active connections to terminate. A timed (200ms) callback closes the connections, which eventually closes the server. The start is the time when the server close is invoked. The end is the time when the server is actually closed(onClose call back invoked). Given that there is a minimum delay of 200ms before the connections are terminated, expecting the elapsed time above 190 is reasonable and fair, but looks like the leeway of 800ms for the upper bounds seem to be too stringent, and breaking some scenarios of network load. Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> PR-URL: https://github.com/joyent/node/pull/14129
-rw-r--r--test/simple/test-child-process-fork-net2.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/simple/test-child-process-fork-net2.js b/test/simple/test-child-process-fork-net2.js
index 098870d48e..b6735a5954 100644
--- a/test/simple/test-child-process-fork-net2.js
+++ b/test/simple/test-child-process-fork-net2.js
@@ -149,13 +149,13 @@ if (process.argv[2] === 'child') {
server.listen(common.PORT, '127.0.0.1');
- var timeElasped = 0;
+ var timeElapsed = 0;
var closeServer = function() {
console.error('[m] closeServer');
var startTime = Date.now();
server.on('close', function() {
console.error('[m] emit(close)');
- timeElasped = Date.now() - startTime;
+ timeElapsed = Date.now() - startTime;
});
console.error('[m] calling server.close');
@@ -174,7 +174,7 @@ if (process.argv[2] === 'child') {
assert.equal(disconnected, count);
assert.equal(connected, count);
assert.ok(closeEmitted);
- assert.ok(timeElasped >= 190 && timeElasped <= 1000,
- 'timeElasped was not between 190 and 1000 ms');
+ assert.ok(timeElapsed >= 190 && timeElapsed <= 5000,
+ 'timeElapsed (' + timeElapsed + ') was not between 190 and 5000 ms');
});
}