From 349380d2dd00d38b26d52170e4cee6d3f3cc6a6f Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Wed, 20 Nov 2024 16:12:12 +0000 Subject: [PATCH] 8344346: java/net/httpclient/ShutdownNow.java fails with java.lang.AssertionError: client was still running, but exited after further delay: timeout should be adjusted --- test/jdk/java/net/httpclient/ShutdownNow.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/net/httpclient/ShutdownNow.java b/test/jdk/java/net/httpclient/ShutdownNow.java index 47eb1f6d7c96a..21cce575b8d47 100644 --- a/test/jdk/java/net/httpclient/ShutdownNow.java +++ b/test/jdk/java/net/httpclient/ShutdownNow.java @@ -72,6 +72,7 @@ import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import jdk.test.lib.RandomFactory; +import jdk.test.lib.Utils; import jdk.test.lib.net.SimpleSSLContext; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; @@ -211,7 +212,7 @@ void testConcurrent(String uriString) throws Exception { } CompletableFuture.allOf(responses.toArray(new CompletableFuture[0])).get(); } finally { - if (client.awaitTermination(Duration.ofMillis(2500))) { + if (client.awaitTermination(Duration.ofMillis(Utils.adjustTimeout(1000)))) { out.println("Client terminated within expected delay"); assertTrue(client.isTerminated()); } else { @@ -277,7 +278,7 @@ void testSequential(String uriString) throws Exception { }).thenCompose((c) -> c).get(); } } finally { - if (client.awaitTermination(Duration.ofMillis(2500))) { + if (client.awaitTermination(Duration.ofMillis(Utils.adjustTimeout(1000)))) { out.println("Client terminated within expected delay"); assertTrue(client.isTerminated()); } else {