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

Commit 66b243d

Browse files
gireeshpunathilmhdawson
authored andcommitted
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 <[email protected]> PR-URL: #14129
1 parent c657dac commit 66b243d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/simple/test-child-process-fork-net2.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ if (process.argv[2] === 'child') {
149149

150150
server.listen(common.PORT, '127.0.0.1');
151151

152-
var timeElasped = 0;
152+
var timeElapsed = 0;
153153
var closeServer = function() {
154154
console.error('[m] closeServer');
155155
var startTime = Date.now();
156156
server.on('close', function() {
157157
console.error('[m] emit(close)');
158-
timeElasped = Date.now() - startTime;
158+
timeElapsed = Date.now() - startTime;
159159
});
160160

161161
console.error('[m] calling server.close');
@@ -174,7 +174,7 @@ if (process.argv[2] === 'child') {
174174
assert.equal(disconnected, count);
175175
assert.equal(connected, count);
176176
assert.ok(closeEmitted);
177-
assert.ok(timeElasped >= 190 && timeElasped <= 1000,
178-
'timeElasped was not between 190 and 1000 ms');
177+
assert.ok(timeElapsed >= 190 && timeElapsed <= 5000,
178+
'timeElapsed (' + timeElapsed + ') was not between 190 and 5000 ms');
179179
});
180180
}

0 commit comments

Comments
 (0)