-
Notifications
You must be signed in to change notification settings - Fork 30k
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: replace port in dgram cb test #12942
Conversation
It would be great if your commit messages and PR titles could be less generic. Having multiple PRs with identical titles makes it really hard to track what's going on. Including the test name would be helpful. |
You got it, will change the commit messages and name of the PRs. Thanks |
@Trott updated the PR titles and commit message headings. Let me know your thoughts. |
Thanks. That's much easier to differentiate in notifications. |
Thank you. I am still new and appreciate learning best practices. Thanks for taking the time to explain. |
@@ -14,4 +14,14 @@ const onMessage = common.mustCall(function(err, bytes) { | |||
client.close(); | |||
}); | |||
|
|||
client.send(buf, common.PORT, common.localhostIPv4, onMessage); | |||
const portGetter = dgram.createSocket('udp4') |
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.
You could just use the existing client
socket here.
Call |
Oh, I see, thanks for the help. |
For anyone reviewing, see discussion in #12929. |
@@ -14,4 +14,4 @@ const onMessage = common.mustCall(function(err, bytes) { | |||
client.close(); | |||
}); | |||
|
|||
client.send(buf, common.PORT, common.localhostIPv4, onMessage); | |||
client.bind(0, () => client.send(buf, client.address().port, common.localhostIPv4, onMessage)); |
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 line is too long, the linter will not like it.
@lpinca All done, wrapped arguments to shorten line length. |
@@ -0,0 +1,23 @@ | |||
'use strict'; |
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.
Has this new test been added by mistake?
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.
Yes, I'm sorry my mistake, give me a second and I will correct that.
Replaced common.PORT in the following test. test-dgram-send-callback-buffer.js Ref: #12376
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
Landed in e00116d. |
Replaced common.PORT in the following test.
test-dgram-send-callback-buffer.js
Ref: #12376
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test dgram