Skip to content

Commit

Permalink
test: scale keepalive timeouts for slow machines
Browse files Browse the repository at this point in the history
The test was using fixed timeouts and that seems to be causing sporadic
test failures on pi1-docker host (which is a very slow machine.)

Fixes: #30828

PR-URL: #30834
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
bnoordhuis authored and targos committed Dec 9, 2019
1 parent af01417 commit 97e0efe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/sequential/test-https-server-keep-alive-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ test(function serverKeepAliveTimeoutWithPipeline(cb) {
common.mustCall((req, res) => {
res.end();
}, 3));
server.setTimeout(500, common.mustCall((socket) => {
server.setTimeout(common.platformTimeout(500), common.mustCall((socket) => {
// End this test and call `run()` for the next test (if any).
socket.destroy();
server.close();
cb();
}));
server.keepAliveTimeout = 50;
server.keepAliveTimeout = common.platformTimeout(50);
server.listen(0, common.mustCall(() => {
const options = {
port: server.address().port,
Expand All @@ -57,13 +57,13 @@ test(function serverKeepAliveTimeoutWithPipeline(cb) {

test(function serverNoEndKeepAliveTimeoutWithPipeline(cb) {
const server = https.createServer(serverOptions, common.mustCall(3));
server.setTimeout(500, common.mustCall((socket) => {
server.setTimeout(common.platformTimeout(500), common.mustCall((socket) => {
// End this test and call `run()` for the next test (if any).
socket.destroy();
server.close();
cb();
}));
server.keepAliveTimeout = 50;
server.keepAliveTimeout = common.platformTimeout(50);
server.listen(0, common.mustCall(() => {
const options = {
port: server.address().port,
Expand Down

0 comments on commit 97e0efe

Please sign in to comment.