RFR: 8371559: Intermittent timeouts in test javax/net/ssl/Stapling/HttpsUrlConnClient.java

Mikhail Yankelevich myankelevich at openjdk.org
Fri Dec 12 17:09:54 UTC 2025


On Fri, 12 Dec 2025 09:30:23 GMT, Arno Zeller <azeller at openjdk.org> wrote:

> The test javax/net/ssl/Stapling/HttpsUrlConnClient.java sometimes hangs and run into timeouts. By adding some more tracing it showed that it can happen on machines with high load that the client thread throws a "Server not ready yet" RuntimeException because it only waits for 5 seconds for the server thread to come available.
> I added some more output in case of errors to better see the issue and use the timeout factor to modify the maximum wait time.

test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java line 36:

> 34:  */
> 35: 
> 36: import java.io.*;

minor: Since you're touching this file, could you please change wildcard imports to explicit

test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java line 78:

> 76:     static String KEYALG;
> 77: 
> 78:     static final double TIMEOUT_FACTOR = Double.parseDouble(System.getProperty("test.timeout.factor", "1.0"));

Nit: could you please keep lines under 80 characters long?

test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java line 317:

> 315: 
> 316:         // Wait 5 seconds for server ready
> 317:         int maxWait = (int)(TIMEOUT_FACTOR * 100);

Do you think it might be better to use something like `Duration.ofSeconds(Utils.adjustTimeout(20));` which will automatically scale sleep? You won't need to get the timeout factor either on the line 78

Something like this. 
Suggestion:

final Duration waitTime = Duration.ofSeconds(Utils.adjustTimeout(1));
for (int i = 0; (i < 100 && !serverReady); i++) {
            Thread.sleep(waitTime);
        }

test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java line 322:

> 320:         }
> 321:         if (!serverReady) {
> 322:             System.out.println("Server wasn't ready after " + maxWait / 20 + " seconds");

I might be missing something, but why are you dividing by 20 here? Was it supposed to be 100 sec * timeout factor?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28784#discussion_r2614975465
PR Review Comment: https://git.openjdk.org/jdk/pull/28784#discussion_r2614950548
PR Review Comment: https://git.openjdk.org/jdk/pull/28784#discussion_r2614968904
PR Review Comment: https://git.openjdk.org/jdk/pull/28784#discussion_r2614972277


More information about the security-dev mailing list