JDK-8305847 : Improve diagnosability and resilience of HttpClient::close tests
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-04-11
  • Updated: 2023-04-20
  • Resolved: 2023-04-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b19Fixed
Related Reports
Relates :  
Description
The HttpClient close tests could be improved to provide better diagnosis. The test makes some requests and register some dependent action 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 body will not be read nor close, which will 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 can be confusing for failure analysis. Also, the test executor - called 'readerService' in which dependent actions are executed should not be closed until all dependent actions have been submitted. Instead of having one such executor per test method, it would be simpler and more resilient to create it in `setup()` and close it in `teardown()`.
Comments
Changeset: 90b4006b Author: Daniel Fuchs <dfuchs@openjdk.org> Date: 2023-04-13 15:27:45 +0000 URL: https://git.openjdk.org/jdk/commit/90b4006bce6a4c28f93297da06be3b30d02fa89f
13-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13426 Date: 2023-04-11 13:46:16 +0000
11-04-2023