Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
  • Loading branch information
addaleax committed Jan 29, 2018
commit c7f7b0342a20b2db9a26494a4ff983ada0a698be
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