-
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
test, win: fix IPv6 detection on Windows #14865
Conversation
cc @nodejs/platform-windows |
Turns out that 2 tests are failing now, which previously where skipped. The reason is the same as with #14111 - |
@@ -17,7 +17,7 @@ const server = net | |||
|
|||
server.listen(common.PORT); | |||
|
|||
net.connect({ port: server.address().port, host: server.address().address }, | |||
net.connect({ port: server.address().port, host: '::1' }, |
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'd rather have this as a property of common
like:
https://github.com/nodejs/node/blob/73894dad9d74671377c79dc7542b41813237c3cc/test/common/index.js#L200-L221
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 +1 on this and +1 on fixing adress().adress
, but this PR is about fixing common.hasIPv6
. I would like to make just the test suit pass, and leave such improvements for other PRs.
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.
Does localhost
work? If so can we use that (see references in #14900 (comment)).
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 localhost
will work because of #6307
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.
Does that apply? Doesn't windows have an equivalent of /etc/hosts
that it just looks up to find the address? I'm sure we're using localhost
in a bunch of other tests.
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.
But it will resolve to 127.0.0.1
.
I'm trying to figure out if ::
was just used for convenience, or if IPv6 has any significance.
I'm trying to figure out why this test has
https://github.com/nodejs/node/blob/73894dad9d74671377c79dc7542b41813237c3cc/test/async-hooks/test-graph.tcp.js#L4-L5
Cross-ref: #14900 |
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.
::1
is easy enough to grep
@@ -17,7 +17,7 @@ const server = net | |||
|
|||
server.listen(common.PORT); | |||
|
|||
net.connect({ port: server.address().port, host: server.address().address }, | |||
net.connect({ port: server.address().port, host: '::1' }, |
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 localhost
will work because of #6307
I opened #14900 for fixing |
@bzoz since I found |
df419d8
to
73894da
Compare
@refack I've pushed your commit out because I want to keep this simple. I've added a simple fix for the failing tests only to keep the CI green. With this PR I want to only fix IPv6 detection for tests. |
@bzoz did you try |
No problems. |
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.
Still LGTM
Add proper IPv6 detection on loopback device on Windows. PR-URL: nodejs#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: nodejs#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
73894da
to
59a2128
Compare
CI after rebase: https://ci.nodejs.org/job/node-test-pull-request/9823/ |
Add proper IPv6 detection on loopback device on Windows. PR-URL: #14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: #14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Looks like the last commit was pushed with some problematic
Fixing now. There will be a force-push to |
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: nodejs#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Re-pushed as 88b8592, back to your regularly scheduled business! :) |
Add proper IPv6 detection on loopback device on Windows. PR-URL: nodejs/node#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: nodejs/node#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Add proper IPv6 detection on loopback device on Windows. PR-URL: nodejs/node#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: nodejs/node#14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Add proper IPv6 detection on loopback device on Windows. PR-URL: #14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: #14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Add proper IPv6 detection on loopback device on Windows. PR-URL: #14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
The 'test-graph.tcp' and 'test-tcpwrap' tests are using '::' as server address. This is mapped to localhost on Linux, but fails on Windows. PR-URL: #14865 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
I've noticed that
common.hasIPv6
is set tofalse
on my Win box. This adds proper IPv6 detection on loopback devices on Windows.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test
/cc @nodejs/testing