RFR for JDK-6963118 Intermittent test failure: test/java/nio/channels/Selector/Wakeup.java fail intermittently (win)

David Holmes david.holmes at oracle.com
Fri Dec 20 04:18:09 UTC 2013


This should probably be reviewed by the nio-dev folk.

Increasing the timeouts seems okay but how confident are you that this 
is sufficient for a wide range of platforms. In other tests we often see 
timeouts of a few seconds get extended even further, so three seconds is 
not so big.

Also the yield loops:

while (sleeper.entries < 5)
     Thread.yield();

would be better as sleep loops (as used elsewhere) to avoid potential 
issues with yield being a no-op on some platforms (Yes I see it is 
already used that way elsewhere in the test but the sleep is better :) ).

Thanks,
David

On 3/12/2013 12:39 PM, srikalyan chandrashekar wrote:
> Hi all, I am working on bug JDK-6963118
> <https://bugs.openjdk.java.net/browse/JDK-6963118> .
> Root Cause:
> - Sensitive timing dependency between events in Main and Sleeper threads
> are causes for test failure.
>
> Suggested Fix:
>    1) Main thread should wait for more than 1sec(made it 3sec) and check
> more often than 50ms(made it 1ms) intervals , sleeper thread may be
> still waiting for interrupt/wakeup hence main thread waiting for just
> 1sec to flag a failure is premature . The reason is especially on
> windows high priority virus scanners etc run(we faced it when simulating
> failures) and kept the system busy.
>    2) The test is essentially a sequence of 2 events
>    a)Firing up wakeups/interrupts followed by a
>    b)Check
>   Check the sleeper.entries value and yield the main thread as required
> so that the above 2 events step in tandem.
>
> The webrev is hosted at
> http://cr.openjdk.java.net/~cl/host_for_kal/6963118-Wakeup/ .
> Please let me know if you have any comments or suggestions.
>



More information about the core-libs-dev mailing list