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 f205e99

Browse filesBrowse files
santigimenoMyles Borins
authored andcommitted
test: fix tls-no-rsa-key flakiness
In some conditions it can happen that the client-side socket is destroyed before the server-side socket has gracefully closed, thus causing a 'ECONNRESET' error in this socket. To solve this, wait in the client-side socket for the 'end' event before closing it. PR-URL: #4043 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent b66db49 commit f205e99
Copy full SHA for f205e99

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+9
-2
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-tls-no-rsa-key.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-no-rsa-key.js
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,16 @@ var server = tls.createServer(options, function(conn) {
2323
var c = tls.connect(common.PORT, {
2424
rejectUnauthorized: false
2525
}, function() {
26+
c.on('end', common.mustCall(function() {
27+
c.end();
28+
server.close();
29+
}));
30+
31+
c.on('data', function(data) {
32+
assert.equal(data, 'ok');
33+
});
34+
2635
cert = c.getPeerCertificate();
27-
c.destroy();
28-
server.close();
2936
});
3037
});
3138

0 commit comments

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