From 9c2918831e5b6acda30820f4161944c7986298d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Fri, 8 Nov 2024 16:23:07 +0100 Subject: [PATCH 1/5] 8342811: Increase PlainProxyConnectionTest logging verbosity --- .../httpclient/PlainProxyConnectionTest.java | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index a3157b0ac37c1..a7922e2193f73 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -25,6 +25,8 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; +import jdk.httpclient.test.lib.common.HttpServerAdapters; + import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; @@ -51,18 +53,39 @@ /** * @test - * @bug 8230526 + * @bug 8230526 8342811 * @summary Verifies that PlainProxyConnections are cached and reused properly. We do this by * verifying that the remote address of the HTTP exchange (on the fake proxy server) - * is always the same InetSocketAddress. - * @modules jdk.httpserver - * @run main/othervm -Djdk.tracePinnedThreads=full PlainProxyConnectionTest + * is always the same InetSocketAddress. Logging verbosity is increased to aid in + * diagnosis of intermittent failures reported in 8342811. + * @library /test/lib + * /test/jdk/java/net/httpclient/lib + * @modules java.base/sun.net.www.http + * java.base/sun.net.www + * java.base/sun.net + * java.net.http/jdk.internal.net.http.common + * java.net.http/jdk.internal.net.http.frame + * java.net.http/jdk.internal.net.http.hpack + * jdk.httpserver + * @run main/othervm -Djdk.tracePinnedThreads=full + * -Djdk.httpclient.HttpClient.log=headers,requests,trace + * -Djdk.internal.httpclient.debug=true + * PlainProxyConnectionTest * @author danielfuchs */ public class PlainProxyConnectionTest { + // Increase logging verbosity to troubleshoot intermittent failures reported in 8342811 + static { + HttpServerAdapters.enableServerLogging(); + } + static final String RESPONSE = "

Hello World!"; - static final String PATH = "/foo/"; + + // Adding some salt to the path to avoid other parallel running tests mistakenly connect to our test server + private static final String PATH = String.format( + "/%s-%d", PlainProxyConnectionTest.class.getSimpleName(), PlainProxyConnectionTest.class.hashCode()); + static final ConcurrentLinkedQueue connections = new ConcurrentLinkedQueue<>(); private static final AtomicInteger IDS = new AtomicInteger(); From 2f95f962618256bcea180fecdfd6a26aeec5ad55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Fri, 8 Nov 2024 16:55:18 +0100 Subject: [PATCH 2/5] Fix copyright year --- test/jdk/java/net/httpclient/PlainProxyConnectionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index a7922e2193f73..be4af23a27b3d 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From 57912c0f5599dd41e757a57acbe146383be6fec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Mon, 11 Nov 2024 09:34:13 +0100 Subject: [PATCH 3/5] Remove redundant module declarations --- test/jdk/java/net/httpclient/PlainProxyConnectionTest.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index be4af23a27b3d..7e949f962d9a4 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -60,13 +60,6 @@ * diagnosis of intermittent failures reported in 8342811. * @library /test/lib * /test/jdk/java/net/httpclient/lib - * @modules java.base/sun.net.www.http - * java.base/sun.net.www - * java.base/sun.net - * java.net.http/jdk.internal.net.http.common - * java.net.http/jdk.internal.net.http.frame - * java.net.http/jdk.internal.net.http.hpack - * jdk.httpserver * @run main/othervm -Djdk.tracePinnedThreads=full * -Djdk.httpclient.HttpClient.log=headers,requests,trace * -Djdk.internal.httpclient.debug=true From 295ff7674e03342402dfddc33954eb36cc86a491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Fri, 15 Nov 2024 09:44:48 +0100 Subject: [PATCH 4/5] Remove redundant `@author` tag Co-authored-by: Daniel Fuchs <67001856+dfuch@users.noreply.github.com> --- test/jdk/java/net/httpclient/PlainProxyConnectionTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index 7e949f962d9a4..d87ef8943dacb 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -64,7 +64,6 @@ * -Djdk.httpclient.HttpClient.log=headers,requests,trace * -Djdk.internal.httpclient.debug=true * PlainProxyConnectionTest - * @author danielfuchs */ public class PlainProxyConnectionTest { From 8cec4a7769f71dc0ca44e8c9e0bbfadcb0531927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?= Date: Fri, 15 Nov 2024 09:48:15 +0100 Subject: [PATCH 5/5] Remove references to the ticket ID --- test/jdk/java/net/httpclient/PlainProxyConnectionTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java index d87ef8943dacb..f8671103ec4cd 100644 --- a/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java +++ b/test/jdk/java/net/httpclient/PlainProxyConnectionTest.java @@ -53,11 +53,11 @@ /** * @test - * @bug 8230526 8342811 + * @bug 8230526 * @summary Verifies that PlainProxyConnections are cached and reused properly. We do this by * verifying that the remote address of the HTTP exchange (on the fake proxy server) * is always the same InetSocketAddress. Logging verbosity is increased to aid in - * diagnosis of intermittent failures reported in 8342811. + * diagnosis of intermittent failures. * @library /test/lib * /test/jdk/java/net/httpclient/lib * @run main/othervm -Djdk.tracePinnedThreads=full @@ -67,7 +67,7 @@ */ public class PlainProxyConnectionTest { - // Increase logging verbosity to troubleshoot intermittent failures reported in 8342811 + // Increase logging verbosity to troubleshoot intermittent failures static { HttpServerAdapters.enableServerLogging(); }