Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f6c9a2b

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
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: #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>
1 parent 74a823c commit f6c9a2b
Copy full SHA for f6c9a2b

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-tls-session-cache.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-session-cache.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ function doTest(testOptions, callback) {
6969
server.on('newSession', function(id, data, cb) {
7070
++newSessionCount;
7171
// Emulate asynchronous store
72-
setTimeout(function() {
72+
setImmediate(() => {
7373
assert.ok(!session);
7474
session = { id, data };
7575
cb();
76-
}, 1000);
76+
});
7777
});
7878
server.on('resumeSession', function(id, callback) {
7979
++resumeCount;
@@ -89,9 +89,9 @@ function doTest(testOptions, callback) {
8989
}
9090

9191
// Just to check that async really works there
92-
setTimeout(function() {
92+
setImmediate(() => {
9393
callback(null, data);
94-
}, 100);
94+
});
9595
});
9696

9797
server.listen(0, function() {
@@ -132,7 +132,7 @@ function doTest(testOptions, callback) {
132132
}
133133
assert.strictEqual(code, 0);
134134
server.close(common.mustCall(function() {
135-
setTimeout(callback, 100);
135+
setImmediate(callback);
136136
}));
137137
}));
138138
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.