RFR: 8308336: Test java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java failed: java.net.BindException: Address already in use

Daniel Fuchs dfuchs at openjdk.org
Fri May 26 13:36:57 UTC 2023


On Fri, 26 May 2023 12:57:59 GMT, Darragh Clarke <duke at openjdk.org> wrote:

> `HttpURLConnectionExpectContinueTest` was throwing an error due to port being hardcoded, updated test to let the system decide which port to use.

test/jdk/java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java line 76:

> 74:         control.serverSocket = new ServerSocket();
> 75:         control.serverSocket.setReuseAddress(true);
> 76:         control.serverSocket.bind(new InetSocketAddress("127.0.0.1", 0));

While you're at it can you change the address to use `InetAddress.getLoopbackAddress()`here, and the URIBuilder in createConnection() below?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14177#discussion_r1206793826


More information about the net-dev mailing list