Browse Source

test: reduce timeouts in test-net-keepalive

Previously 1000-1200ms, they're now (platform dependent) 50-100ms.

Improves test run time on my machine from 0m1.335s to 0m0.236s.

PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
v4.0.0-rc
Brendan Ashworth 9 years ago
parent
commit
0d39d35739
  1. 6
      test/parallel/test-net-keepalive.js

6
test/parallel/test-net-keepalive.js

@ -8,8 +8,8 @@ var echoServer = net.createServer(function(connection) {
serverConnection = connection;
connection.setTimeout(0);
assert.notEqual(connection.setKeepAlive, undefined);
// send a keepalive packet after 1000 ms
connection.setKeepAlive(true, 1000);
// send a keepalive packet after 50 ms
connection.setKeepAlive(true, common.platformTimeout(50));
connection.on('end', function() {
connection.end();
});
@ -27,5 +27,5 @@ echoServer.on('listening', function() {
serverConnection.end();
clientConnection.end();
echoServer.close();
}, 1200);
}, common.platformTimeout(100));
});

Loading…
Cancel
Save