RFR: 8282270: java/awt/Robot Screen Capture tests fail after 8280861
Alexey Ivanov
aivanov at openjdk.java.net
Wed Mar 9 10:35:55 UTC 2022
On Tue, 8 Mar 2022 16:10:02 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>>> > I submitted a job for testing the changes.
>>>
>>> Thanks a lot!
>>
>> I got 1 failure out of 15 on Linux for `java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java`. The screenshot of the entire screen has no open windows: just plain desktop background. It was probably captured after the test was shutdown.
>>
>> The test doesn't save the captured image on failure, does it?
>>
>> It's crucial to save the captured images, otherwise we're blind and left to guess what Robot captured and why it didn't match.
>
>> @aivanov-jdk Could you please re-run the test? Thanks once more!
>
> Sorry for my delayed reply.
>
> One failure reported:
>
> command: main -Dsun.java2d.win.uiScaleX=3 -Dsun.java2d.win.uiScaleY=2 HiDPIRobotScreenCaptureTest
> ...
> ----------System.out:(3/218)----------
> Creating screen capture of java.awt.Rectangle[x=83,y=97,width=400,height=300]
> Checking (100, 75) to have color java.awt.Color[r=0,g=255,b=0]
> ... Mismatch: found java.awt.Color[r=135,g=8,b=69] instead. Check image.png.
> ----------System.err:(12/723)----------
> java.lang.RuntimeException: Wrong image color!
> at HiDPIRobotScreenCaptureTest.checkRectColor(HiDPIRobotScreenCaptureTest.java:125)
> at HiDPIRobotScreenCaptureTest.main(HiDPIRobotScreenCaptureTest.java:108)
> ...
>
> 
>
> The checked point (x, y) = (100, 75) is 10 pixels into the green square but it's 55 pixels above the square.
> @aivanov-jdk Thanks for re-running the test. Where does this failure come from - Linux or Windows? The saved image's size is correct (400x300 px), but I can't explain the location of the painted area inside it and why it is so small...
It's Linux, Ubuntu 20.10. Neither can I.
I checked the history and the test failed on different hosts, so it could be an intermittent bug in JDK itself.
~~Shouldn't the image be larger than 400×300? The size of the frame is 400×300 in user's space, the test is running with uiScaleX=3 and uiScaleY=2, therefore the size of the frame should be 1200×600. In some cases, such a size may not fit on the screen.~~ I see these `sun.java2d.win.uiScale{X,Y}` affect Windows only. On Ubuntu, the test runs according to the system settings.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7613
More information about the client-libs-dev
mailing list