RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v4]
Kevin Rushforth
kcr at openjdk.org
Wed Apr 2 11:23:59 UTC 2025
On Tue, 1 Apr 2025 20:47:32 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Yes, there are two main approaches we could take:
>>
>> Option 1: A utility that is available for developers to add to one or more specific tests in a branch in their personal fork when debugging failures in those tests. We would not add it to any test in the mainline repo in this case. Since it is a developer-only utility, it isn't necessary to have a system property to enable it.
>>
>> Option 2: A utility that is added to all robot tests in the repo, with a flag to enable it (off by default).
>>
>> There are pros / cons of each approach. The second approach is more likely to catch a failing test that fails rarely and would easily allow us to enable it and run it on a new platform (e.g., for testing a new version of macOS or Ubuntu), although it is also more prone to the "runaway" screenshot problem unless we can come up with a good way to limit it.
>>
>> I left a couple usability questions that are independent of this. It probably makes sense to address those first and then come back to this.
>
> I would choose the Option 1 (debug utility), with an addition of a static `ScreenCapture.takeScreenshot()`.
>
> I don't think there is a need to add this tool to the hundreds of tests which work just fine.
I would agree with this given the limitations using the annotation (especially the fact that it runs _after_ the `@AfterEach` method) and that we have no good way to throttle it.
If we go this way, the final version of the PR would need to remove the annotation from the existing tests.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1746#discussion_r2024623918
More information about the openjfx-dev
mailing list