RFR: 8367991: Update RegionBackground tests to use ScreenCaptureTestWatcher utility [v2]
Kevin Rushforth
kcr at openjdk.org
Fri Sep 19 12:21:56 UTC 2025
On Fri, 19 Sep 2025 10:18:52 GMT, Jayathirth D V <jdv at openjdk.org> wrote:
>> We are seeing very rare intermittent failures in RegionBackgroundFillUITest & RegionBackgroundImageUITest tests in linux. We already have [JDK-8328217](https://bugs.openjdk.org/browse/JDK-8328217) to fix this issue.
>>
>> To identify the root cause better, we want to capture the test content when it is failing using ScreenCaptureTestWatcher utility.
>>
>> Since we wan to capture the test window before test stage is cleared. We are now clearing the test stage and next test setup. Initially tried updating this behaviour in `VisualTestBase` itself, but that causes tests like `test.robot.test3d.PointLightIlluminationTest` as it overrides the test setup functions.
>>
>> This change is tested to make sure ScreenCaptureTestWatcher takes appropriate screen capture on failure and CI full headful test run is green.
>
> Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision:
>
> Add missing initialization logic
This approach requires each test to copy logic from the base class into the test class, so it will be harder to maintain and doesn't scale well.
My recommendation is to either:
1. Make the changes to move the hiding of the changes to the base class methods, change all subclasses that currently have a different `@AfterEach` method _not_named `doSetup` to rename their `@BeforeEach` method to `doSetup()` and call `super.doSetup()` as the first statement of the overridden method
2. Create a protected utility method in VisualTestBase that a subclass can call.
I think 1 might be better, since it keeps all of the logic in the base class, but 2 would be OK as well, since the actual cleaning of the stages would remain in the base class, but it does require overriding the two methods.
-------------
PR Review: https://git.openjdk.org/jfx/pull/1913#pullrequestreview-3244612867
More information about the openjfx-dev
mailing list