RFR: 8305847: Improve diagnosability and resilience of HttpClient::close tests
Daniel Jeliński
djelinski at openjdk.org
Thu Apr 13 12:32:24 UTC 2023
On Tue, 11 Apr 2023 13:46:16 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> The HttpClient close tests could be improved to provide better diagnosis.
>
> The tests make some requests and register some dependent actions to check the response state, followed by some dependent action that will read the request body (from an input stream). But if the first dependent action asserts, the second will not be executed, and the body will neither be read or closed.
> This will later prevent HttpClient::close method, or the HttpClient::awaitTermination method, to terminate as expected, and the test will then later fail in timeout (either from jtreg or awaitTermination). This behaviour can be confusing for failure analysis.
>
> The tests could also be further simplified by creating the executor in which the responses bodies will eventually be read (called `readerService`) in the `setup()` method and later close it in `teardown()`. This will simplify the cleanup phase, and ensure the service does not get closed until all dependent actions have been scheduled.
Marked as reviewed by djelinski (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/13426#pullrequestreview-1383303807
More information about the net-dev
mailing list