-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: implement common.skipIfNoIpv6Localhost #16248
Conversation
cb51f1d
to
3160827
Compare
Fixed lint errors. New CI: https://ci.nodejs.org/job/node-test-pull-request/10779/ cc @nodejs/testing |
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
Nit: should this change to be a |
@maclover7 Yeah that's what I originally named this..I think at that point I thought the semantics of this did not align with other |
f0726ae
to
bbeab1a
Compare
@mhdawson @maclover7 Rebased and renamed , PTAL. |
LGTM |
This is failing on raspberry pis since they don't have ipv6 support and the tests |
Removed the common.mustCall since uh...the point of this PR is to skip the callbacks when ipv6 localhost is not available...¯\(ツ)/¯ |
Which run the callback with a local host that can be resolved to ::1 if available, otherwise skip the test.
caffada
to
92af228
Compare
Rebased. New CI: https://ci.nodejs.org/job/node-test-pull-request/11372/ |
@@ -20,7 +19,7 @@ function runTest() { | |||
res.end(); | |||
})).listen(0, '::1', common.mustCall(function() { | |||
const options = { | |||
host: 'localhost', | |||
host: ipv6Host, |
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.
given that // This test that the family option of https.get is honored.
would it be correct to replace this with '::1'
since this what the server bind to?
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.
@refack I think replacing it with a ip would skip the family
option handling altogether. The family option is used when performing a lookup, so if the connection doesn't even need to lookup then it won't be tested. In net.js:
// If host is an IP, skip performing a lookup
var addressType = cares.isIP(host);
if (addressType) {
nextTick(self[async_id_symbol], function() {
if (self.connecting)
internalConnect(self, host, port, addressType, localAddress, localPort);
});
return;
}
....
var dnsopts = {
family: options.family,
hints: options.hints || 0
};
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.
Let's think is this is not overkill?
AFAICT those two test can skip the DNS calls, so if they work with |
Uh..those tests are testing DNS calls, |
Use common.skipIfNoIpv6Localhost
Use common.skipIfNoIpv6Localhost
92af228
to
8097bd8
Compare
Ah, forgot to run the linter...also the arm compilation seems to be having a outage? |
I want to dig into that. let's see if we can refactor something around this. |
Closing in favor of #16976 |
PR-URL: nodejs#16976 Refs: nodejs#16248 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#16976 Refs: nodejs#16248 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Refs: #15936 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test