test: fix tls-inception flakiness
authorSantiago Gimeno <santiago.gimeno@gmail.com>
Tue, 8 Dec 2015 13:57:22 +0000 (14:57 +0100)
committerMyles Borins <mborins@us.ibm.com>
Tue, 19 Jan 2016 19:52:21 +0000 (11:52 -0800)
commitd00b9fc66f6e48e142f8bdf705a87bcb1e7bf316
tree6c22e86d309cd711b4b9fa6bfe16313fe77a7b1f
parentc41b280a2bb0e36146f317479d18fcd105049b40
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: https://github.com/nodejs/node/pull/4195
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
test/parallel/test-tls-inception.js