-
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: Avoid usage of mixed IPV6 addresses #7702
Conversation
@gireeshpunathil Do you want to make a similar change to gc/test-net-timeout.js to fix #7291? It seems to be the same problem, so I guess it would make sense to do it in the same PR. |
@gibfahn - sure, will check. |
@gireeshpunathil I've checked @quaidn 's suggested fix at #7291 (comment) and it seems to work. diff --git a/test/gc/test-net-timeout.js b/test/gc/test-net-timeout.js
index ff1d565..0e68f78 100644
--- a/test/gc/test-net-timeout.js
+++ b/test/gc/test-net-timeout.js
@@ -36,7 +36,11 @@ function getall() {
return;
(function() {
- var req = net.connect(server.address().port, server.address().address);
+ if (server.address().family === 'IPv4') {
+ var req = net.connect(server.address().port, '127.0.0.1');
+ } else {
+ var req = net.connect(server.address().port, '::1');
+ }
req.resume();
req.setTimeout(10, function() {
//console.log('timeout (expected)') |
The problem is with the lack of cohesion between what is documented in the server.listen documentation and what is requested by the client in the proposed fix. For example, the API spec says 'If the hostname is omitted, the server will accept connections on any IPv6 address (::) when IPv6 is available'. When connecting to a server socket thus created, it becomes problematic if we use '::1' which is basically the loopback address, not 'any address'. While everything works in Linux magically, I see an issue in Mac. For better traceability, I suggest we separate this (AIX) from #7291 (windows). I can work with you on that further. |
@gireeshpunathil Okay, if they're different fixes I agree it makes sense to do different PRs. |
|
Oh, wait never mind my previous comment. That sets an array, not a single address value. This change LGTM. |
/cc @bnoordhuis |
s/Avoid/avoid/ in the commit status line, otherwise LGTM. |
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens.
Made the changes to commit message (s/Avoid/avoid/) as advised by @bnoordhuis |
CI looks good landing |
landed as 17883df |
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens. Fixes: #7563 PR-URL: #7702 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens. Fixes: #7563 PR-URL: #7702 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens. Fixes: #7563 PR-URL: #7702 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens. Fixes: #7563 PR-URL: #7702 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens. Fixes: #7563 PR-URL: #7702 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The test case fails in AIX due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in AIX. (In Windows too, but does not manifest as the test is omitted in Windows for a different reason). There exists no documented evidence which supports the mixed use of unspecified and loopback addresses. While AIX strictly follows the IPV6 specification with respect to unspecified address ('::') and loopback address ('::1'), the test case latches on to the behavior exhibited by other platforms, and hence it fails in AIX. The proposed fix is to make it work in all platforms including AIX by using the loopback address for the client to connect, as that is the address at which the server listens. Fixes: #7563 PR-URL: #7702 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test, cluster
Description of change
Please see #7563 for full details.
The test case test/parallel/test-cluster-disconnect-handles.js
fails in AIX due to the mixed-use of unspecified
and loopback addresses. This is not a problem in most platforms
but fails in AIX. (In Windows too, but does not manifest as the
test is omitted in Windows for a different reason).
There exists no documented evidence which supports the mixed use
of unspecified and loopback addresses.
While AIX strictly follows the IPV6 specification with respect to
unspecified address ('::') and loopback address ('::1'), the test
case latches on to the behavior exhibited by other platforms,
and hence it fails in AIX.
The proposed fix is to make it work in all platforms including
AIX by using the loopback address for the client to connect,
as that is the address at which the server listens.