diff options
author | Eric Anderson <ejona@google.com> | 2017-11-02 12:51:35 -0700 |
---|---|---|
committer | Eric Anderson <ejona@google.com> | 2017-11-02 13:32:34 -0700 |
commit | f9f603570d20d4507f4d90a3dc53915ac7db4d33 (patch) | |
tree | 3af57591db15817612921373b0f49be31dcda47e /testing | |
parent | 37a67bf04111c0a9d42a7722b89bab028c882000 (diff) | |
download | grpc-grpc-java-f9f603570d20d4507f4d90a3dc53915ac7db4d33.tar.gz |
Allow tests to run on IPv6-less machines
Our Travis-CI builds are failing with "Protocol family unavailable" due
to the usage of ::1. Although it's 2017 and we'd expect to have ipv6
_loopback_ anywhere that mattered, apparently that's not the case.
The tests now work equally well on IPv4-only and IPv6-only machines.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/src/main/java/io/grpc/internal/testing/TestUtils.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testing/src/main/java/io/grpc/internal/testing/TestUtils.java b/testing/src/main/java/io/grpc/internal/testing/TestUtils.java index 649e8e09f..8ca934ec3 100644 --- a/testing/src/main/java/io/grpc/internal/testing/TestUtils.java +++ b/testing/src/main/java/io/grpc/internal/testing/TestUtils.java @@ -67,7 +67,7 @@ public class TestUtils { */ public static InetSocketAddress testServerAddress(int port) { try { - InetAddress inetAddress = InetAddress.getByName("::1"); + InetAddress inetAddress = InetAddress.getByName("localhost"); inetAddress = InetAddress.getByAddress(TEST_SERVER_HOST, inetAddress.getAddress()); return new InetSocketAddress(inetAddress, port); } catch (UnknownHostException e) { |