RFR 8065076/9, test/java/net/SocketPermission/SocketPermissionTest.java failed intermittently
Chris Hegarty
chris.hegarty at oracle.com
Wed Jan 20 06:36:57 UTC 2016
Felix,
On 14 Jan 2016, at 06:07, Felix Yang <felix.yang at oracle.com> wrote:
> Hi all,
> please review the fix for test/java/net/SocketPermission/SocketPermissionTest.java, which fails frequently with "java.net.BindException: Address already in use".
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8065076
> Webrev: http://cr.openjdk.java.net/~xiaofeya/8065076/webrev.00
My preference is to avoid getFreePort. It is problematic and I believe just obfuscates
the intermittent failures further.
In many of the test scenarios the “listening” socket can be created before the specific
access control context and associated permission are created.
I’ll see if I can get some time to try this out.
-Chris.
> The test uses getFreePort() test util library to verify permission on specific "host:port". This fix added retries to avoid possible binding failures:
> 1. A port may be still occupied for a short moment after socket close.
> 2. Another application is possible to occupy the same port during the short time window of open-close-reuse. This has been observed in experimental test runs.
>
> Thanks,
> Felix
>
>
More information about the core-libs-dev
mailing list