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

Abhishek Kumar abhiscxk at openjdk.org
Thu Sep 5 12:04:53 UTC 2024


On Thu, 5 Sep 2024 10:23:15 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.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated with review comments

test/jdk/java/awt/Checkbox/CheckboxCheckerScalingTest.java line 49:

> 47:     private static Frame frame;
> 48:     private static Checkbox checkbox;
> 49:     private static Point point;

`point` is accessed across multiple threads, should be declared as `volatile`. No need to declare `checkmarkFound ` as `volatile`, it is accessed only in main thread.

test/jdk/java/awt/Checkbox/CheckboxCheckerScalingTest.java line 82:

> 80:                         if (compareColor(pixelColor)) {
> 81:                             colorCounter++;
> 82:                             if (colorCounter >= COLOR_CHECK_THRESHOLD) {

Just a suggestion, Could be merged in one statement
`if (++colorCounter >= COLOR_CHECK_THRESHOLD) {`

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

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


More information about the client-libs-dev mailing list