RFR: 8239801: [macos] java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java fails

Damon Nguyen dnguyen at openjdk.org
Fri Nov 18 20:43:50 UTC 2022


On Fri, 18 Nov 2022 20:23:22 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> This is an older test that failed intermittently but had a fix specifically for mac systems by adding key presses on mac only. This test still intermittently failed after this fix long ago and was problem listed. 
>> 
>> I ran this test 100 times on each OS after applying waitForIdle and delays between all key presses to match the delays previously present in the test.
>> 
>> I also added a debug line and save and image of the failing window upon failure to better debug if/when the test ever fails again. The debug line is to check if the previous fix for mac is relevant in the failure. The image shows the status of the window and what is focused at the time of failure.
>
> test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 150:
> 
>> 148:             // Save image to better debug the status of test when failing
>> 149:             Rectangle screenRect = new Rectangle(100, 200,
>> 150:                     win.getWidth(), win.getHeight() + 20);
> 
> Suggestion: You can capture the frame as well as window by using the following (it captures the entire testing screen).
> 
> GraphicsConfiguration ge = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
> BufferedImage failImage = robot.createScreenCapture(ge.getBounds());

I can update it to capture the screen instead if that's preferred. I initially had it this way, but I figured it was better to just show the window that is being tested alone. If it's better to capture the whole screen for debugging purposes, I can make this change.

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

PR: https://git.openjdk.org/jdk/pull/11227



More information about the client-libs-dev mailing list