RFR: 8295991: java/net/httpclient/CancelRequestTest.java fails intermittently

Daniel Fuchs dfuchs at openjdk.org
Tue Nov 1 11:46:46 UTC 2022


The CancelRequestTest test has been observed failing (once). It was recently updated to verify that subscribers would be correctly unregistered after the request was cancelled. However, the timeout used to wait for that to happen was optimistically too short: the test code that cancels the request is by design racy, so it's not guaranteed that the subscriber will be unregistered before the completable future is cancelled, it might get unregistered asynchronously shortly after.
Increasing the timeout to wait for that to happen from 1ms to 100ms fixes the test issue.

-------------

Commit messages:
 - 8295991

Changes: https://git.openjdk.org/jdk/pull/10931/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10931&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8295991
  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/10931.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10931/head:pull/10931

PR: https://git.openjdk.org/jdk/pull/10931


More information about the net-dev mailing list