diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-03-03 04:10:28 -0500 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-03-03 16:07:37 -0500 |
commit | e1bf6709dc720fa06359ccd745d81cafc37dbd39 (patch) | |
tree | b02b4635844590e0f2b0116b3ad8a41f64d677e3 /test/parallel/test-tls-inception.js | |
parent | e0835c9cda8ad515e407baff0c3515d6f105fd14 (diff) | |
download | android-node-v8-e1bf6709dc720fa06359ccd745d81cafc37dbd39.tar.gz android-node-v8-e1bf6709dc720fa06359ccd745d81cafc37dbd39.tar.bz2 android-node-v8-e1bf6709dc720fa06359ccd745d81cafc37dbd39.zip |
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: https://github.com/iojs/io.js/issues/1012
PR-URL: https://github.com/iojs/io.js/pull/1040
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Diffstat (limited to 'test/parallel/test-tls-inception.js')
-rw-r--r-- | test/parallel/test-tls-inception.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index 76c747aadb..83b12a6938 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -28,6 +28,10 @@ a = tls.createServer(options, function (socket) { var dest = net.connect(options); dest.pipe(socket); socket.pipe(dest); + + dest.on('close', function() { + socket.destroy(); + }); }); // the "target" server |