RFR: 8301243: java/net/httpclient/http2/IdleConnectionTimeoutTest.java intermittent failure
Conor Cleary
ccleary at openjdk.org
Tue Feb 7 15:52:39 UTC 2023
### Description ###
Intermittent failures of this test are observed on frequent `HttpClient` test runs. The test checks that the same connection is not used twice for two seperate requests if an Idle Connection Timeout occurs by verifying that the client-side port does not use the same port. It also verifies that when an Idle Connection Timeout does not occur, the same connection is used by verifying that the port used in both requests is the same.
The issue here is that there is no guarantee that the ports used will not be the same for when an Idle Connection Timeout occurs and so the test will/does fail intermittently.
### Summary of Changes & Justification ###
Instead of comparing the post numbers of the connections used for each request in all test cases, the connections themselves are now compared with calls to `hashCode()` like so. The connection instances themselves are accessed by using a customised `ExchangeSupplier` for the `Http2TestServer`.
-------------
Commit messages:
- 8301243: java/net/httpclient/http2/IdleConnectionTimeoutTest.java intermittent failure
Changes: https://git.openjdk.org/jdk/pull/12457/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12457&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8301243
Stats: 65 lines in 1 file changed: 41 ins; 1 del; 23 mod
Patch: https://git.openjdk.org/jdk/pull/12457.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12457/head:pull/12457
PR: https://git.openjdk.org/jdk/pull/12457
More information about the net-dev
mailing list