RFR: 8088739: [TestBug] RegionBackgroundImageUITest fail with timeout error

Kevin Rushforth kcr at openjdk.java.net
Mon Nov 2 14:14:55 UTC 2020


On Fri, 30 Oct 2020 16:04:51 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

> Each test in RegionBackgroundImageUITest makes several calls to `robot.getPixelColor()` on App thread. Due to this each test requires more than **60** seconds for execution.
> 
> Fix is to save a screen capture of Scene (on App thread) and then read pixel color from the screen capture(not on app thread). This reduces execution time of each test to less than **3** seconds.
> Ideally with this fix(commit#1) all the tests should pass. All tests do pass on Windows and Linux but three tests fail on Mac, which used to pass without this change.
> - RegionBackgroundImageUITest.unalignedImage
> - RegionBackgroundFillUITest.testScenario2
> - RegionBackgroundFillUITest.testScenario3
> 
> commit#2 solves the above problem. Solution is to fallback to test color again by reading it using `robot.getPixelColor()` on App thread when a test fails.
> 
> One test RegionBackgroundImageUITest.unalignedImage_Cover, fails only on Mac platform, before and after this fix.
> It is reported as a new issue [JDK-8255679](https://bugs.openjdk.java.net/browse/JDK-8255679)
> 
> This is a test fix and affects only the tests that extend from `RegionUITestBase` test class and does not affect other tests.
> Verified that `RegionBackgroundImageUITest` and `RegionBackgroundFillUITest` tests pass on all three platforms(except RegionBackgroundImageUITest.unalignedImage_Cover which fails on Mac).

The fact that you needed to implement a fallback to `Robot::getPixelColor` if reading a pixel from the buffer obtained by `Robot::getScreenCapture` fails (on Mac) suggests that `RegionBackgroundImageUITest` has some issues running on HiDPI displays. It also points out that there is a difference between the scaling algorithm used to read a single pixel vs an array of pixels (this might be a bug in Robot itself).

I confirmed the fact that these problems are related to HiDPI scaling by running it on my Windows 10 system with 125% scaling, and I get 30 test failures. I instrumented the code and I see a couple hundred fallbacks per test even for the non-failing tests. If I force screen scale to 1 on Windows then all tests pass with no fallbacks.

We used to have this problem for some of the tests in `RegionBackgroundFillUITest` as well. The fix for [JDK-8170026](https://bugs.openjdk.java.net/browse/JDK-8170026) addressed this by skipping the tests that were sensitive to screen scale (14 of them).  You either need to do something similar for `RegionBackgroundImageUITest` or else fix the tests to work with different screen scales (this would be challenging).

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

Changes requested by kcr (Lead).

PR: https://git.openjdk.java.net/jfx/pull/344


More information about the openjfx-dev mailing list