From 043aeaf02a50a7413e1956a99341d04ea3f9ac92 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Thu, 25 Sep 2025 14:30:47 +0000 Subject: [PATCH] 8368552: H3ErrorHandlingTest.testCloseControlStream intermittent timed out Reviewed-by: dfuchs --- .../httpclient/http3/H3ErrorHandlingTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java b/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java index 10a3a3af8f2..4315fd36de5 100644 --- a/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java +++ b/test/jdk/java/net/httpclient/http3/H3ErrorHandlingTest.java @@ -34,6 +34,7 @@ import jdk.internal.net.quic.QuicTransportException; import jdk.internal.net.quic.QuicVersion; import jdk.test.lib.net.SimpleSSLContext; import jdk.test.lib.net.URIBuilder; +import jdk.test.lib.Utils; import org.testng.IRetryAnalyzer; import org.testng.ITestResult; import org.testng.annotations.AfterClass; @@ -802,7 +803,7 @@ public class H3ErrorHandlingTest implements HttpServerAdapters { final HttpResponse response = client.sendAsync( request, BodyHandlers.discarding()) - .get(10, TimeUnit.SECONDS); + .get(Utils.adjustTimeout(10), TimeUnit.SECONDS); fail("Expected the request to fail, got " + response); } catch (Exception e) { final String expectedMsg = "stateless reset from peer"; @@ -943,7 +944,7 @@ public class H3ErrorHandlingTest implements HttpServerAdapters { final HttpResponse response = client.sendAsync( request, BodyHandlers.discarding()) - .get(10, TimeUnit.SECONDS); + .get(Utils.adjustTimeout(10), TimeUnit.SECONDS); fail("Expected the request to fail, got " + response); } catch (ExecutionException e) { System.out.println("Client exception [expected]: " + e); @@ -966,13 +967,13 @@ public class H3ErrorHandlingTest implements HttpServerAdapters { final HttpResponse response = client.sendAsync( request, BodyHandlers.discarding()) - .get(10, TimeUnit.SECONDS); + .get(Utils.adjustTimeout(20), TimeUnit.SECONDS); fail("Expected the request to fail, got " + response); } catch (ExecutionException e) { System.out.println("Client exception [expected]: " + e); var cause = e.getCause(); assertTrue(cause instanceof ProtocolException, "Expected ProtocolException"); - TerminationCause terminationCause = errorCF.get(10, TimeUnit.SECONDS); + TerminationCause terminationCause = errorCF.get(Utils.adjustTimeout(10), TimeUnit.SECONDS); System.out.println("Server reason: \"" + terminationCause.getPeerVisibleReason()+'"'); final long actual = terminationCause.getCloseCode(); // expected @@ -989,13 +990,13 @@ public class H3ErrorHandlingTest implements HttpServerAdapters { final HttpResponse response = client.sendAsync( request, BodyHandlers.discarding()) - .get(10, TimeUnit.SECONDS); + .get(Utils.adjustTimeout(10), TimeUnit.SECONDS); fail("Expected the request to fail, got " + response); } catch (ExecutionException e) { System.out.println("Client exception [expected]: " + e); var cause = e.getCause(); assertTrue(cause instanceof ProtocolException, "Expected ProtocolException"); - TerminationCause terminationCause = errorCF.get(10, TimeUnit.SECONDS); + TerminationCause terminationCause = errorCF.get(Utils.adjustTimeout(10), TimeUnit.SECONDS); System.out.println("Server reason: \"" + terminationCause.getPeerVisibleReason()+'"'); final long actual = terminationCause.getCloseCode(); // expected @@ -1019,13 +1020,13 @@ public class H3ErrorHandlingTest implements HttpServerAdapters { BodyHandlers.discarding(), (initiatingRequest, pushPromiseRequest, acceptor) -> acceptor.apply(BodyHandlers.discarding()) - ).get(10, TimeUnit.SECONDS); + ).get(Utils.adjustTimeout(10), TimeUnit.SECONDS); fail("Expected the request to fail, got " + response); } catch (ExecutionException e) { System.out.println("Client exception [expected]: " + e); var cause = e.getCause(); assertTrue(cause instanceof ProtocolException, "Expected ProtocolException"); - TerminationCause terminationCause = errorCF.get(10, TimeUnit.SECONDS); + TerminationCause terminationCause = errorCF.get(Utils.adjustTimeout(10), TimeUnit.SECONDS); System.out.println("Server reason: \"" + terminationCause.getPeerVisibleReason()+'"'); final long actual = terminationCause.getCloseCode(); // expected