Skip to content

Commit

Permalink
test: reduce timeouts in test-net-keepalive
Browse files Browse the repository at this point in the history
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: #2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
brendanashworth authored and rvagg committed Aug 20, 2015
1 parent b60e690 commit 3545e23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-net-keepalive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand All @@ -27,5 +27,5 @@ echoServer.on('listening', function() {
serverConnection.end();
clientConnection.end();
echoServer.close();
}, 1200);
}, common.platformTimeout(100));
});

0 comments on commit 3545e23

Please sign in to comment.