RFR: 8308336: Test java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java failed: java.net.BindException: Address already in use
Mark Sheppard
msheppar at openjdk.org
Wed Jun 7 10:13:55 UTC 2023
On Fri, 26 May 2023 13:34:08 GMT, Daniel Fuchs <dfuchs 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?
based on Daniel's last comment and requested change then I think it would be useful to add two additional run requests to the test which set the network properties java.net.preferIPv4Stack=true and java.net.preferIPv6Addresses=true, for completeness.
You never know what might "pop out of the woodwork"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14177#discussion_r1221321072
More information about the net-dev
mailing list