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

Alan Bateman Alan.Bateman at oracle.com
Thu Dec 19 10:05:09 PST 2013


On 17/12/2013 19:53, srikalyan 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
>   - Main and sleeper thread must step in tandem(synch) which can be 
> done by checking the sleeper.entries value and yielding the main 
> thread as required.
>
> 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.

Thanks for looking at this one, this is a JDK 1.4-era test that has been 
asking for attention for some time.

The test has been on the exclude list (jdk/test/ProblemList.txt) for a 
long time and we should remove it as part of this change.

As regards the changes then the having the main thread yeild for the 
sleeper thread looks okay. For consistency then it would be good to put 
them after the comment so that it matches the other places.

On the thresholds in check then I agree that 1s is insufficient. I think 
I would probably got 10 or 20 seconds just to be sure (extreme cases 
where you are in -Xcomp and competing with a virus checker).

Looking at the test then it probably could be re-written too (maybe 
using Phaser) but that might be too much for now.

Oh, and I'm happy to sponsor this for you.

-Alan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20131219/4e29d1a2/attachment.html 


More information about the nio-dev mailing list