RFR: 8186765: Speed up test sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java

Daniel Fuchs dfuchs at openjdk.org
Mon Oct 3 15:49:21 UTC 2022


On Mon, 3 Oct 2022 14:35:46 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> This PR reduces the execution time of ProxyAuthTest.
> 
> Before this change the test always required at least 3 minutes to complete (6x 30 seconds timeout in `SSLSocketTemplate`'s `sslServerSocket.accept()`).
> After this change the test does not open a server socket when it is not necessary.
> 
> The test continues to pass.

IIUC the test attempts to connect through a proxy to a server. The proxy needs Basic authentication. There is a system property that will allow/restrict which authentication scheme can be used with a proxy, and the test is run with various settings of that property. If the property doesn't allow the Basic authentication scheme, then the connection through the proxy will not succeed, and the proxy will never forward the request to the server. 
So in the case where we expect that the client stack will reject the request (since the proxy wants Basic) there's no need to start the server - it will never receive any connection anyway.

This LGTM - but it might be good to have someone from security-dev chime in - I'm not too familiar with this SSLSocketTemplate class.

-------------

Marked as reviewed by dfuchs (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10539



More information about the security-dev mailing list