-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
dgram,test: add addMembership/dropMembership tests #6753
Conversation
@@ -71,6 +71,9 @@ socket.on('message', (msg, rinfo) => { | |||
``` | |||
|
|||
### socket.addMembership(multicastAddress[, multicastInterface]) | |||
<!-- YAML | |||
added: v0.6.9 | |||
--> |
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.
These should likely be done as a separate commit
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.
Done!
Couple of minor nits. Otherwise LGTM if CI is green. |
const common = require('../common'); | ||
const assert = require('assert'); | ||
const dgram = require('dgram'); | ||
const multicastAddress = '224.0.0.114'; |
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.
Is this something that could be moved to common
?
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'm on the fence on that. I have a concern that putting that address in common
will signal to people (like me) who don't fully understand multicast that it's OK for tests in parallel
and sequential
to communicate with that address. It's not, I don't think, and that's probably why the existing test that uses that address is in internet
.
This test needs to have an address to test addMembership()
and dropMembership()
, which, now that I think about it, I guess means that this test will cause some IGMP traffic on the local network?
/cc @nodejs/build in the hopes someone who actually understands how multicast works can say "Yup, this test will send a packet" or "Nope, this test does not send a packet on the network."
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.
Hmmm, although 224.0.0.114 would be multicast on the local subnet only, so maybe it's OK in the context of this test? Like, it's not sending packets destined for the Internet or anything...
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 can't say for sure it's true for all platforms but just joining or leaving a local multicast group (which all 224.0.0.xxx addresses are) should not generate any traffic, that's just bookkeeping to the kernel.
LGTM with a comment. I also second @jasnell's nits. |
LGTM, thank you |
socket.addMembership(multicastAddress); | ||
socket.dropMembership(multicastAddress); | ||
} | ||
); |
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.
Missing socket.close()
?
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.
@bnoordhuis Yes, good catch. Added socket.close()
, rebased against current master, force pushed.
Rebased against master, fixed a nit from @bnoordhuis, time to run CI again: https://ci.nodejs.org/job/node-test-pull-request/2685/ |
parallel/test-dgram-membership and the documentation changes LGTM but the style fixes to the other test don't really belong, IMO. Lots of failures on one of the smartos machines although I don't think they're related to this PR. The test itself passes: https://ci.nodejs.org/job/node-test-commit-smartos/2537/nodes=smartos14-64/console |
@bnoordhuis wrote:
True. I'll remove those style changes and re-run CI. If no surprises, landing soon... |
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms.
The only tests for `addMembership()` and `dropMembership()` (from the `dgram` module) were in `test/internet` which means they almost never get run. This adds checks in `test/parallel`. I also did some minor tidying on the existing `test/internet` test.
CI is green. Landing... |
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: nodejs#6753 Ref: nodejs#6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The only tests for `addMembership()` and `dropMembership()` (from the `dgram` module) were in `test/internet` which means they almost never get run. This adds checks in `test/parallel`. PR-URL: nodejs#6753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: nodejs#6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: #6753 Ref: #6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The only tests for `addMembership()` and `dropMembership()` (from the `dgram` module) were in `test/internet` which means they almost never get run. This adds checks in `test/parallel`. PR-URL: #6753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: #6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: #6753 Ref: #6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The only tests for `addMembership()` and `dropMembership()` (from the `dgram` module) were in `test/internet` which means they almost never get run. This adds checks in `test/parallel`. PR-URL: #6753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The only tests for `addMembership()` and `dropMembership()` (from the `dgram` module) were in `test/internet` which means they almost never get run. This adds checks in `test/parallel`. PR-URL: #6753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: nodejs#6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: #6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: #6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: #6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: #6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: #6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: nodejs#6753 Ref: nodejs#6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: #6753 Ref: #6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: #6753 Ref: #6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: #6753 Ref: #6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Since I was doing the necessary git archaeology anyway, I took the time to add YAML information to the docs about when `addMembership()` and `dropMembership()` first appeared in their current forms. PR-URL: #6753 Ref: #6578 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Checklist
Affected core subsystem(s)
test dgram
Description of change
The only tests for
addMembership()
anddropMembership()
(from thedgram
module) were intest/internet
which means they almost neverget run. This adds checks in
test/parallel
.Since I was doing the necessary git archaeology anyway, I took the time
to add YAML information to the docs about when
addMembership()
anddropMembership()
first appeared in their current forms.I also did some minor tidying on the existing
test/internet
test.