RFR: 8374432: TimeoutResponseBodyTest.java#retriesEnabledForResponseFailure fails run with -Xcomp

Volkan Yazici vyazici at openjdk.org
Wed Dec 31 11:08:56 UTC 2025


On Wed, 31 Dec 2025 08:14:09 GMT, SendaoYan <syan at openjdk.org> wrote:

> Hi all,
> 
> The test test/jdk/java/net/httpclient/TimeoutResponseBodyTest.java#retriesEnabledForResponseFailure  was observed timed out when run with jvm option -Xcomp. The failure details shows in [JDK-8374432](https://bugs.openjdk.org/browse/JDK-8374432). Maybe it need more time for C2 to compile the httpclient classes than the default mixed mode.
> 
> So this PR read the timeout factor from jtreg, and apply the timeout factor to `REQUEST_TIMEOUT` by multiply it. Change has been verified locally by run the related tests test/jdk/java/net/httpclient/TimeoutResponseHeaderTest.java and test/jdk/java/net/httpclient/TimeoutResponseBodyTest.java both with -Xmixed and -Xcomp. Test-fix only, no risk,

test/jdk/java/net/httpclient/TimeoutResponseTestSupport.java line 81:

> 79:     protected static final Duration REQUEST_TIMEOUT =
> 80:             Duration.ofMillis(Long.parseLong(System.getProperty("test.requestTimeoutMillis"))
> 81:             * timeoutFactor);

Can we use `jdk.test.lib.Utils::adjustTimeout` instead of manually reading and applying the `test.timeout.factor` system property?

test/jdk/java/net/httpclient/TimeoutResponseTestSupport.java line 111:

> 109:                     .ofMillis(RESPONSE_FAILURE_WAIT_DURATION_MILLIS)
> 110:                     .multipliedBy(RETRY_LIMIT)
> 111:                     .multipliedBy(timeoutFactor);

Similar to what we do with `REQUEST_TIMEOUT`, can we instead use `adjustTimeout` while initializing the `RESPONSE_FAILURE_WAIT_DURATION_MILLIS`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29012#discussion_r2655219886
PR Review Comment: https://git.openjdk.org/jdk/pull/29012#discussion_r2655221165


More information about the net-dev mailing list