HBASE-19198 TestIPv6NIOServerSocketChannel fails; unable to bind

This commit is contained in:
Michael Stack 2017-11-06 21:19:51 -08:00
parent f13cf56f1c
commit 57c0fb2561
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}