-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: use common.mustCall in test-tls-connect-given-socket.js #12592
Conversation
@@ -72,14 +66,14 @@ const server = tls.createServer(options, (socket) => { | |||
|
|||
// Immediate death socket | |||
const immediateDeath = net.connect(port); | |||
establish(immediateDeath).destroy(); | |||
establish(immediateDeath, 0).destroy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense to pass 0 to common.mustCall()
as the expected
argument. I would expect any common.mustCall()
to be passed a value of 1 (or undefined
) or higher. If the intention is that it should never be called, common.mustNotCall()
should be used instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
will result in the default of 1
. I think either we need to be OK with sending 0
to common.mustCall()
(I am, at least in this case) or else add some logic to switch out whether common.mustCall()
or common.mustNotCall()
gets called. That works too, although might be a bit much. I'm fine with either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one was a bit of let's get it working. establish()
is called multiple times with different expected results each time and this was the easiest to get things going. The test as written, however, could use a bit of a bigger refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is green
PR-URL: nodejs#12592 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 72e3dda. |
PR-URL: nodejs#12592 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12592 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12592 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
remove process block and add common.mustCall
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test