test: deflake test-tls-js-stream
`socket.destroy()` can destory the stream before the chunk to write with `socket.end()` is actually sent. Furthermore `socket.destroy()` destroys `p` and not the actual raw socket. As a result it is possible that the connection is left open. Remove `socket.destroy()` to ensure that the chunk is sent. Also use `common.mustCall()` to ensure that the `'secureConnection'` and `'secureConnect'` events are emitted exactly once. PR-URL: https://github.com/nodejs/node/pull/27478 Fixes: https://github.com/nodejs/node/issues/26938 Reviewed-By:Rich Trott <rtrott@gmail.com> Reviewed-By:
Sam Roberts <vieuxtech@gmail.com> Reviewed-By:
Fedor Indutny <fedor.indutny@gmail.com>
parent
9c43e7a1
Please register or sign in to comment