Skip to content

Commit

Permalink
test: speed up parallel/test-tls-session-cache
Browse files Browse the repository at this point in the history
This test had some unnecessary timeouts that made it run for a
much longer time than necessary (about 9 s rather than 0.2 s).

PR-URL: #18424
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
addaleax authored and BridgeAR committed Feb 1, 2018
1 parent 3ca7935 commit 3206e20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-tls-session-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function doTest(testOptions, callback) {
server.on('newSession', function(id, data, cb) {
++newSessionCount;
// Emulate asynchronous store
setTimeout(function() {
setImmediate(() => {
assert.ok(!session);
session = { id, data };
cb();
}, 1000);
});
});
server.on('resumeSession', function(id, callback) {
++resumeCount;
Expand All @@ -89,9 +89,9 @@ function doTest(testOptions, callback) {
}

// Just to check that async really works there
setTimeout(function() {
setImmediate(() => {
callback(null, data);
}, 100);
});
});

server.listen(0, function() {
Expand Down Expand Up @@ -132,7 +132,7 @@ function doTest(testOptions, callback) {
}
assert.strictEqual(code, 0);
server.close(common.mustCall(function() {
setTimeout(callback, 100);
setImmediate(callback);
}));
}));
}
Expand Down

0 comments on commit 3206e20

Please sign in to comment.