test: speed up parallel/test-tls-session-cache
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
3ca79350d9
commit
3206e20af6
@ -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;
|
||||
@ -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() {
|
||||
@ -132,7 +132,7 @@ function doTest(testOptions, callback) {
|
||||
}
|
||||
assert.strictEqual(code, 0);
|
||||
server.close(common.mustCall(function() {
|
||||
setTimeout(callback, 100);
|
||||
setImmediate(callback);
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user