Commit 8c4bd2af authored by Luigi Pinca's avatar Luigi Pinca
Browse files

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: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarSam Roberts <vieuxtech@gmail.com>
Reviewed-By: default avatarFedor Indutny <fedor.indutny@gmail.com>
parent 9c43e7a1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment