RFR: 8338153: java/awt/Checkbox/CheckboxCheckerScalingTest.java test failed on linux machine

Tejesh R tr at openjdk.org
Thu Aug 29 04:25:20 UTC 2024


On Wed, 28 Aug 2024 21:43:29 GMT, Alisen Chung <achung at openjdk.org> wrote:

>> Test failed intermittently on particular host. Though analysis pointed out to a test frame at left top on that host, I've updated the test for further stabilizing it. Two things done here:
>> 1. Move the frame to center of the screen rather than left top.
>> 2. Added tolerance checks for color comparison - this is based on analysis reports where the image didn't had exact black color which is supposed to be. So like other test cases, providing some tolerance for comparison.
>
> test/jdk/java/awt/Checkbox/CheckboxCheckerScalingTest.java line 51:
> 
>> 49:     private static BufferedImage imageAfterChecked;
>> 50:     private static volatile boolean checkmarkFound = false;
>> 51:     private static final int TOLERANCE = 10;
> 
> Is this tolerance needed for the test to pass? Would just moving the test to the center be enough for this fix? I agree with Abhishek that there might be false positives, particularly with color profiles where the test should fail but would pass with this change, especially since this is a ui scaling test.

Tolerance is required when we are going with screen capture comparison since I see slight change in intensity of colors in captured image, not really sure of what might be the exact cause for it on some machines/some test runs. Also I've seen some tests considers this tolerance while testing. I confirmed it by decoding the pixel color of captured image (Below image). 
Coming to false positives, yes this is the trade off when the test is made automatic. I see no other way to confirm the check mark with captured image. Other option left is to make the test manual one, yet I feel this way is better than manual. I've captured several runs without the fix where the captured area will be just white background and with fix when checkmark is drawn on UI scale of 2.0 it is drawn inside the area without any other interference which might have led to false positive.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20723#discussion_r1735548153


More information about the client-libs-dev mailing list