<Swing Dev> [14] RFR [JDK-8221312] test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java failed
abdul.kolarkunnu at oracle.com
abdul.kolarkunnu at oracle.com
Tue Jul 30 11:30:04 UTC 2019
Hi All,
Please review fix for the below bug:
Bug: https://bugs.openjdk.java.net/browse/JDK-8221312
Webrev: http://cr.openjdk.java.net/~akolarkunnu/8221312/webrev.00/
<http://cr.openjdk.java.net/%7Eakolarkunnu/8221312/webrev.00/>
<http://cr.openjdk.java.net/%7Eakolarkunnu/8221312/webrev.00/>
Description:
It's a machine dependent issue, in some machines it works perfectly and
in some machines this issue reproducible consistently.
Also this issue can reproduce by just launching the demo itself,
animation in the demo will become so slow.
So here the issue is in the demo code, In demo it is invoking
Thread.yield() from the animation loop.
Thread context switch is not happening in some iterations, so EDT and
Main threads are not getting CPU cycle. So test case execution is
getting slow and getting timed out.
From Thread.yield javadoc:
/A hint to the scheduler that the current thread is willing to yield its
current use of a processor. The scheduler is free to ignore this hint./
/It is rarely appropriate to use this method. It may be useful for
debugging or testing purposes, where it may help to reproduce bugs due
to race conditions./
//
Fix:
Invoked repaint() in SwingUtilities.invokeAndWait(), so that thread
switch will happen and complete the repaint and proceed for next iteration.
Testing:
Issue was reproducible for me in a local machine and it is not
reproducible after the fix.
Also issue was reproducible in oracle internal test infrastructure,
tested with fix and it works fine.
-Muneer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20190730/4e345116/attachment.html>
More information about the swing-dev
mailing list