|
30 | 30 | * isTerminated. |
31 | 31 | * @library /test/lib /test/jdk/java/net/httpclient/lib |
32 | 32 | * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext |
| 33 | + * jdk.test.lib.RandomFactory jdk.test.lib.Utils |
33 | 34 | * ReferenceTracker |
34 | 35 | * @run testng/othervm |
35 | 36 | * -Djdk.internal.httpclient.debug=true |
|
41 | 42 | import java.io.IOException; |
42 | 43 | import java.io.InputStream; |
43 | 44 | import java.io.OutputStream; |
44 | | -import java.net.InetAddress; |
45 | | -import java.net.InetSocketAddress; |
46 | 45 | import java.net.URI; |
47 | 46 | import java.net.http.HttpClient; |
48 | 47 | import java.net.http.HttpClient.Redirect; |
|
58 | 57 | import java.util.concurrent.CompletionException; |
59 | 58 | import java.util.concurrent.ConcurrentHashMap; |
60 | 59 | import java.util.concurrent.ExecutionException; |
61 | | -import java.util.concurrent.ExecutorService; |
62 | | -import java.util.concurrent.Executors; |
63 | | -import java.util.concurrent.RejectedExecutionException; |
64 | | -import java.util.concurrent.TimeUnit; |
65 | 60 | import java.util.concurrent.atomic.AtomicLong; |
66 | 61 | import jdk.httpclient.test.lib.common.HttpServerAdapters; |
67 | | -import jdk.httpclient.test.lib.http2.Http2TestServer; |
68 | 62 | import javax.net.ssl.SSLContext; |
69 | | -import javax.net.ssl.SSLHandshakeException; |
70 | 63 |
|
71 | | -import com.sun.net.httpserver.HttpServer; |
72 | | -import com.sun.net.httpserver.HttpsConfigurator; |
73 | | -import com.sun.net.httpserver.HttpsServer; |
74 | 64 | import jdk.test.lib.RandomFactory; |
| 65 | +import jdk.test.lib.Utils; |
75 | 66 | import jdk.test.lib.net.SimpleSSLContext; |
76 | 67 | import org.testng.annotations.AfterTest; |
77 | 68 | import org.testng.annotations.BeforeTest; |
@@ -211,7 +202,7 @@ void testConcurrent(String uriString) throws Exception { |
211 | 202 | } |
212 | 203 | CompletableFuture.allOf(responses.toArray(new CompletableFuture<?>[0])).get(); |
213 | 204 | } finally { |
214 | | - if (client.awaitTermination(Duration.ofMillis(2500))) { |
| 205 | + if (client.awaitTermination(Duration.ofMillis(Utils.adjustTimeout(1000)))) { |
215 | 206 | out.println("Client terminated within expected delay"); |
216 | 207 | assertTrue(client.isTerminated()); |
217 | 208 | } else { |
@@ -277,7 +268,7 @@ void testSequential(String uriString) throws Exception { |
277 | 268 | }).thenCompose((c) -> c).get(); |
278 | 269 | } |
279 | 270 | } finally { |
280 | | - if (client.awaitTermination(Duration.ofMillis(2500))) { |
| 271 | + if (client.awaitTermination(Duration.ofMillis(Utils.adjustTimeout(1000)))) { |
281 | 272 | out.println("Client terminated within expected delay"); |
282 | 273 | assertTrue(client.isTerminated()); |
283 | 274 | } else { |
|
0 commit comments