The issue was reported on the net-dev mailing list:
https://mail.openjdk.java.net/pipermail/net-dev/2020-July/014191.html
There is a subtle timing hole introduced into the HttpURLConWithProxy.java test with the fix for JDK-8183369.
When using GC stress modes, a consistent failure can be observed:
"Execution failed: `main' threw exception: java.lang.RuntimeException: Connection not retried with proxy".
It can be verified that the Proxy is being used but the messages are not being logged with the ProxyHandler. The issue is caused by back to back calls of Logger.getLogger(String). If a GC happens between the two calls
there is no guarantee that the same object will be returned.
Since the test relies on the log messages being handled by the new ProxyHandler to pass, the test needs to ensure the Logger object stays live for the entire lifetime of the test.