Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

bzoz
Copy link
Contributor

@bzoz bzoz commented Aug 16, 2017

I've noticed that common.hasIPv6 is set to false on my Win box. This adds proper IPv6 detection on loopback devices on Windows.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

/cc @nodejs/testing

@bzoz bzoz added test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform. labels Aug 16, 2017
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 16, 2017
@bzoz
Copy link
Contributor Author

bzoz commented Aug 16, 2017

@tniessen
Copy link
Member

cc @nodejs/platform-windows

@bzoz
Copy link
Contributor Author

bzoz commented Aug 17, 2017

Turns out that 2 tests are failing now, which previously where skipped. The reason is the same as with #14111 - :: is used as server address, and Windows needs ::1. I've added a commit to this PR to fix this, PTAL

@@ -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' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

Copy link
Member

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)).

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor

@refack refack Aug 17, 2017

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

@refack
Copy link
Contributor

refack commented Aug 17, 2017

Cross-ref: #14900

Copy link
Contributor

@refack refack left a 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' },
Copy link
Contributor

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

@refack
Copy link
Contributor

refack commented Aug 17, 2017

I opened #14900 for fixing server.address().address.
I'm convinced that ::1 is a good stop gap solution.

@refack
Copy link
Contributor

refack commented Aug 18, 2017

@bzoz since I found test/async-hooks/test-graph.tcp.js to be confusing (and independent of IPv6), I've added a suggesting to clean it up. Obviously feel free to push it out.

@bzoz bzoz force-pushed the bartek-win-test-ipv6 branch from df419d8 to 73894da Compare August 21, 2017 17:45
@bzoz
Copy link
Contributor Author

bzoz commented Aug 21, 2017

@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.

@gibfahn
Copy link
Member

gibfahn commented Aug 21, 2017

@bzoz did you try localhost?

@refack
Copy link
Contributor

refack commented Aug 21, 2017

@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.

No problems.
I'll open a follow up PR.

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM

bzoz added 2 commits August 24, 2017 14:29
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>
@bzoz bzoz force-pushed the bartek-win-test-ipv6 branch from 73894da to 59a2128 Compare August 24, 2017 12:31
@bzoz
Copy link
Contributor Author

bzoz commented Aug 24, 2017

bzoz added a commit that referenced this pull request Aug 24, 2017
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>
bzoz added a commit that referenced this pull request Aug 24, 2017
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>
@bzoz
Copy link
Contributor Author

bzoz commented Aug 24, 2017

Landed in 1a0f19a, ca9b3f2

@bzoz bzoz closed this Aug 24, 2017
@Fishrock123
Copy link
Contributor

Looks like the last commit was pushed with some problematic ^M in the metadata:

test: fix async-hooks tests

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: https://github.com/nodejs/node/pull/14865^MReviewed-By: James M Snell <jasnell@gmail.com>^MReviewed-By: Refael Ackermann <refack@gmail.com>

Fixing now. There will be a force-push to master!

Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Aug 24, 2017
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>
@Fishrock123
Copy link
Contributor

Re-pushed as 88b8592, back to your regularly scheduled business! :)

addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
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>
addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
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>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
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>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
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>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
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>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
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>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
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>
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants