From 4c4f620570b289e106fb5b1210b0788df435a1b8 Mon Sep 17 00:00:00 2001 From: Daniel Jelinski Date: Fri, 10 Oct 2025 22:05:25 +0200 Subject: [PATCH] Remove request timeout --- .../http3/H3MalformedResponseTest.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/test/jdk/java/net/httpclient/http3/H3MalformedResponseTest.java b/test/jdk/java/net/httpclient/http3/H3MalformedResponseTest.java index 16e110b5fa05e..881277da1f82c 100644 --- a/test/jdk/java/net/httpclient/http3/H3MalformedResponseTest.java +++ b/test/jdk/java/net/httpclient/http3/H3MalformedResponseTest.java @@ -338,10 +338,9 @@ public void testWellFormedResponse(String desc, byte[] response) throws Exceptio HttpClient client = getHttpClient(); try { HttpRequest request = getRequest(); - final HttpResponse response1 = client.sendAsync( + final HttpResponse response1 = client.send( request, - BodyHandlers.discarding()) - .get(10, TimeUnit.SECONDS); + BodyHandlers.discarding()); assertEquals(response1.statusCode(), 200); assertFalse(errorCF.isDone(), "Expected the connection to be open"); } finally { @@ -366,13 +365,10 @@ public void testMalformedResponse(String desc, byte[] response) throws Exception HttpClient client = getHttpClient(); try { HttpRequest request = getRequest(); - final HttpResponse response1 = client.sendAsync( + final HttpResponse response1 = client.send( request, - BodyHandlers.discarding()) - .get(Utils.adjustTimeout(10), TimeUnit.SECONDS); + BodyHandlers.discarding()); fail("Expected the request to fail, got " + response1); - } catch (TimeoutException e) { - throw e; } catch (Exception e) { System.out.println("Got expected exception: " +e); e.printStackTrace(); @@ -395,13 +391,10 @@ public void testMalformedResponse2(String desc, byte[] response) throws Exceptio HttpClient client = getHttpClient(); try { HttpRequest request = getRequest(); - final HttpResponse response1 = client.sendAsync( + final HttpResponse response1 = client.send( request, - BodyHandlers.discarding()) - .get(10, TimeUnit.SECONDS); + BodyHandlers.discarding()); fail("Expected the request to fail, got " + response1); - } catch (TimeoutException e) { - throw e; } catch (Exception e) { System.out.println("Got expected exception: " +e); e.printStackTrace();