Skip to content

Commit e1bf670

Browse files
committed
test: fix racey-ness in tls-inception
Fix test failure on FreeBSD and SmartOS, which happens due to a bad timing: events.js:141 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET at exports._errnoException (util.js:734:11) at TLSWrap.onread (net.js:538:26) The outer `net.conncet()` socket stays alive after the inner socket is gone. This happens because `.pipe()`'s implementation does not `destroy` the source side when the destination has emitted `close`. Fix: #1012 PR-URL: #1040 Reviewed-By: Chris Dickinson <[email protected]>
1 parent e0835c9 commit e1bf670

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/parallel/test-tls-inception.js

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ a = tls.createServer(options, function (socket) {
2828
var dest = net.connect(options);
2929
dest.pipe(socket);
3030
socket.pipe(dest);
31+
32+
dest.on('close', function() {
33+
socket.destroy();
34+
});
3135
});
3236

3337
// the "target" server

0 commit comments

Comments
 (0)