<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
Thu Aug 1 14:58:44 UTC 2019


Hi Sergey,

I tested SwingSet2 demo also on the same machine and issue is reproducible.

So applied same fix in SwingSet2 also, and issue not reproducible after 
the fix.

New webrev :http://cr.openjdk.java.net/~akolarkunnu/8221312/webrev.01/ 
<http://cr.openjdk.java.net/%7Eakolarkunnu/8221312/webrev.01/>

-Muneer


On 01/08/19 7:17 AM, Sergey Bylokhov wrote:
> Hi, Abdul.
>
> I guess you need to update the SwingSet2 demo as well.
>
> On 30.07.2019 04:30, abdul.kolarkunnu at oracle.com wrote:
>> 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
>>
>
>



More information about the swing-dev mailing list