diff -r c76699d2e572 -r 9a2855e0a796 test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java --- a/test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java Tue Feb 06 10:34:47 2018 +0000 +++ b/test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java Tue Feb 06 11:04:44 2018 +0000 @@ -145,7 +145,7 @@ ssc = ServerSocketChannel.open(); try { ssc.configureBlocking(true); - ssc.bind(new InetSocketAddress("localhost", 0)); + ssc.bind(new InetSocketAddress(0)); address = (InetSocketAddress) ssc.getLocalAddress(); thread.start(); } catch (IOException e) { @@ -165,7 +165,7 @@ if (!started.get()) { throw new IllegalStateException("Not yet started"); } - return URI.create("ws://" + address.getHostName() + ":" + address.getPort()); + return URI.create("ws://localhost:" + address.getPort()); } private boolean readRequest(SocketChannel channel, StringBuilder request)