Skip to content

Commit

Permalink
8344346: java/net/httpclient/ShutdownNow.java fails with java.lang.As…
Browse files Browse the repository at this point in the history
…sertionError: client was still running, but exited after further delay: timeout should be adjusted
  • Loading branch information
dfuch committed Nov 20, 2024
1 parent c4c6b1f commit 349380d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/jdk/java/net/httpclient/ShutdownNow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 349380d

Please sign in to comment.