Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Commit

Permalink
test: fix tls-inception flakiness
Browse files Browse the repository at this point in the history
cherry-picked the following from master

commit 3b94991
Author: Santiago Gimeno <santiago.gimeno@gmail.com>
Date:   Tue Dec 8 14:57:22 2015 +0100

    test: fix tls-inception flakiness

    When sending a very large buffer (400000 bytes) the test fails due
    to the client socket from the `a` server erroring with `ECONNRESET`.
    There's a race condition between the closing of this socket and the
    `ssl` socket closing on the other side of the connection. To improve
    things, destroy the socket as soon as possible: in the `end` event
    of the `dest` socket.

    PR-URL: nodejs/node#4195
    Reviewed-By: Brian White <mscdex@mscdex.net>
    Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
jBarz committed Feb 19, 2017
1 parent 041610b commit 6b68c09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/simple/test-tls-inception.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ a = tls.createServer(options, function (socket) {
var dest = net.connect(options);
dest.pipe(socket);
socket.pipe(dest);
dest.on('end', function() {
socket.destroy();
});
});

// the "target" server
Expand Down

0 comments on commit 6b68c09

Please sign in to comment.