RFR: 8266900: java/net/httpclient/ShortResponseBody.java fails on windows with java.io.IOException: Unable to establish loopback connection

Daniel Fuchs dfuchs at openjdk.org
Thu Oct 20 13:58:47 UTC 2022


On Thu, 20 Oct 2022 12:58:13 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> This PR reduces the number of requests performed by ShortResponseBody* tests from 570 to 100. It also reduces the number of httpclients created from one per request/URL to one per 10 requests. This in turn will translate to reduced frequency of failures caused by all ephemeral ports being in use.
> 
> Before this patch each test URL was repeated 12 times: 3 times with a dedicated client, then 3 more times with a client shared across all requests, repeated for sync and async.
> After this patch each test URL is checked only 2 times, once with sync and once with async call.
> 
> The tests continue to pass.

test/jdk/java/net/httpclient/ShortResponseBody.java line 135:

> 133:             }
> 134:         }
> 135:         numberOfRequests++;

Did you mean `numberOfRequests = (numberOfRequests % REQUESTS_PER_CLIENT) + 1;` to match the description of the changes?

test/jdk/java/net/httpclient/ShortResponseBody.java line 706:

> 704:     @AfterTest
> 705:     public void teardown() throws Exception {
> 706:         if (sharedClient != null) sharedClient = null;

should probably null `client` here?

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

PR: https://git.openjdk.org/jdk/pull/10794


More information about the net-dev mailing list