RFR: 8338153: java/awt/Checkbox/CheckboxCheckerScalingTest.java test failed on linux machine
Abhishek Kumar
abhiscxk at openjdk.org
Wed Aug 28 09:38:24 UTC 2024
On Tue, 27 Aug 2024 06:04:47 GMT, Tejesh R <tr 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 78:
> 76: for (int j = 0; j < imageAfterChecked.getWidth(); j++) {
> 77: Color pixelColor = new Color(imageAfterChecked.getRGB(i, j));
> 78: if (compareColor(pixelColor)) {
Current pixel comparison suggests that the test passes even if one pixel satisfies the condition. This may give some false positive result.
Is it possible to test all pixel and then check the number of pixels passed against total number of pixels compared and if it is more than some percentage value ( may be ~85-90) then return true otherwise false.
This may lead to avoid the tolerance check if sufficient number of pixels are exactly black in color.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20723#discussion_r1734337419
More information about the client-libs-dev
mailing list