[9] RFR: 8134267: javax/net/ssl/TLS/TestJSSE.java fails intermittently with BindException: Address already in use
Chris Hegarty
chris.hegarty at oracle.com
Thu May 19 08:03:33 UTC 2016
On 18 May 2016, at 22:57, Artem Smotrakov <artem.smotrakov at oracle.com> wrote:
> Hello,
>
> Please review the following patch for javax/net/ssl/TLS/TestJSSE.java test.
>
> The test fails intermittently with BindException because it can use a busy port. The test uses jdk.testlibrary.Utils.getFreePort() which creates a server socket, and returns its local port number. Then this port number is used to creates a new SSL server socket. It looks like the port may be already busy when a new SSL socket is being created.
Thank you for changing this. getFreePort is a bad pattern that leads to
intermittent failures. We should remove its usage wherever possible.
> The patch removes usage of jdk.testlibrary.Utils.getFreePort(). Now the SSL server creates a server socket by calling SSLServerSocketFactory.createServerSocket(0) which opens a socket on a free port. Then this port number is passed to the client.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8134267
> Webrev: http://cr.openjdk.java.net/~asmotrak/8134267/webrev.00/
The changes look good to me.
-Chris.
More information about the security-dev
mailing list