RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]
Andy Goryachev
angorya at openjdk.org
Tue Apr 1 20:46:12 UTC 2025
On Tue, 1 Apr 2025 19:51:16 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Andy Goryachev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> data url
>
> tests/system/src/test/java/test/util/ScreenCaptureTestWatcher.java line 59:
>
>> 57: public void testFailed(ExtensionContext extensionContext, Throwable err) {
>> 58: // can be pasted into Safari address bar
>> 59: System.err.println(generateScreenshot("Screenshot:{\ndata:image/png;base64,", null));
>
> I'm not sure if an inline base64-encoded image -- between 2 and 3 megabytes of ascii text that needs to be copy/pasted -- is the best choice from a usability point of view. Have you considered writing PNG files? One drawback of my suggestion is that getting it back from a remote Jenkins build is more complicated.
yes, and you pointed to the problem exactly - not only it creates a difficult task of retrieving files from the remote system, require a [complex] cleanup schedule, as well as run a risk of losing the files after a while and impossibility of finding the right screenshot after the fact (sometimes much later).
at the same time, the suggested approach keeps the screenshot in the context, available for analysis at any point in time. the only drawback is base-64 inflation of about 33-37% relative to the raw binary.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1746#discussion_r2023650628
More information about the openjfx-dev
mailing list