mirror of https://github.com/nodejs/node.git
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>pull/2429/merge
parent
2052941149
commit
0d39d35739
|
@ -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…
Reference in New Issue