Integrated: 8305847: Improve diagnosability and resilience of HttpClient::close tests
Daniel Fuchs
dfuchs at openjdk.org
Thu Apr 13 15:32:14 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.
This pull request has now been integrated.
Changeset: 90b4006b
Author: Daniel Fuchs <dfuchs at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/90b4006bce6a4c28f93297da06be3b30d02fa89f
Stats: 278 lines in 4 files changed: 168 ins; 54 del; 56 mod
8305847: Improve diagnosability and resilience of HttpClient::close tests
Reviewed-by: jpai, djelinski
-------------
PR: https://git.openjdk.org/jdk/pull/13426
More information about the net-dev
mailing list