RFR: 8305847: Improve diagnosability and resilience of HttpClient::close tests
Daniel Fuchs
dfuchs at openjdk.org
Tue Apr 11 13:54:42 UTC 2023
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.
-------------
Commit messages:
- 8305847
Changes: https://git.openjdk.org/jdk/pull/13426/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13426&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8305847
Stats: 278 lines in 4 files changed: 168 ins; 54 del; 56 mod
Patch: https://git.openjdk.org/jdk/pull/13426.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13426/head:pull/13426
PR: https://git.openjdk.org/jdk/pull/13426
More information about the net-dev
mailing list