JDK 9 RFR of JDK-8068693/8153209: (ch) test java/nio/channels/AsyncCloseAndInterrupt.java failing

Martin Buchholz martinrb at google.com
Tue Apr 5 17:23:30 UTC 2016


The use of sleeps in these tests is disturbing.  Occasionally they're
necessary, but usually they can be removed. For example

 574         do {
 575             sleep(50);
 576         } while (!t.ready);

Instead of making ready a volatile flag and spin-sleeping, make it a
CountDownLatch that you can await


On Tue, Apr 5, 2016 at 5:03 AM, Hamlin Li <huaming.li at oracle.com> wrote:
> Would you please review the patch for test
> java/nio/channels/AsyncCloseAndInterrupt.java?
>
> There are 2 test issues, JDK-8068693, JDK-8153209
> (java/nio/channels/AsyncCloseAndInterrupt.java fails throwing exception:
> java.nio.channels.ClosedChannelException).
> Root cause:
>   for JDK-8068693, 500ms is too short on busy system for channel to be
> closed or for thread blocking on IO to be interrupted.
>   for JDK-8153209, it's a test regression due to JDK-8151582
> (http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/88577677aec9). There is a time
> window between thread ready and io operation ready, deleting the original
> sleep(100) might cause channel closed before accessing the channel.
> Suggested Fix:
>   for JDK-8068693, increase the time from 500ms to 10000ms.
>   for JDK-8153209, do not sleep when running tests for
> CONNECT/FINISH_CONNECT, sleep for other test cases.
>
> bug: https://bugs.openjdk.java.net/browse/JDK-8068693,
> https://bugs.openjdk.java.net/browse/JDK-8153209
> webrev: http://cr.openjdk.java.net/~mli/8068693/webrev.00/
>
> Thank you
> -Hamlin


More information about the nio-dev mailing list