From 57c0fb2561b63384d38072ba0bf16f7182a3a5cc Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Mon, 6 Nov 2017 21:19:51 -0800 Subject: [PATCH] HBASE-19198 TestIPv6NIOServerSocketChannel fails; unable to bind --- .../apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java index d4f4adaa368..e63eaf24e3b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestIPv6NIOServerSocketChannel.java @@ -49,7 +49,6 @@ import org.junit.rules.TestRule; */ @Category({MiscTests.class, SmallTests.class}) public class TestIPv6NIOServerSocketChannel { - private static final Log LOG = LogFactory.getLog(TestIPv6NIOServerSocketChannel.class); @Rule @@ -69,6 +68,7 @@ public class TestIPv6NIOServerSocketChannel { break; } catch (BindException ex) { //continue + LOG.info("Failed on " + addr + ", inedAddr=" + inetAddr, ex); } finally { if (serverSocket != null) { serverSocket.close(); @@ -151,9 +151,9 @@ public class TestIPv6NIOServerSocketChannel { */ @Test public void testServerSocketFromLocalhostResolution() throws IOException { - InetAddress[] addrs = InetAddress.getAllByName("localhost"); + InetAddress[] addrs = {InetAddress.getLocalHost()}; for (InetAddress addr : addrs) { - LOG.info("resolved localhost as:" + addr); + LOG.info("Resolved localhost as: " + addr); bindServerSocket(addr); bindNIOServerSocket(addr); }