Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-04-05 Thread Andy Goryachev
On Fri, 28 Mar 2025 21:09:55 GMT, Kevin Rushforth wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of t

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v2]

2025-04-05 Thread Andy Goryachev
On Mon, 31 Mar 2025 16:01:39 GMT, Kevin Rushforth wrote: >> The intent is not to annotate each test, but rather to use this tool to >> debug the issues in an intermittently failing test. > > Hmm. That isn't what I thought we were doing. I thought the idea was to > annotate most (if not all all)

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v5]

2025-04-05 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > The log contains a base

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v4]

2025-04-05 Thread Kevin Rushforth
On Tue, 1 Apr 2025 20:47:32 GMT, Andy Goryachev 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

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-04 Thread Kevin Rushforth
On Tue, 1 Apr 2025 22:42:25 GMT, Kevin Rushforth wrote: >> Turns out one can't intercept assertion exceptions with >> `Thread.setDefaultUncaughtExceptionHandler()` (duh!), so this is likely to >> be a known limitation. >> >> We might still provide general purpose methods in `ScreenCapture` (ne

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-04 Thread Andy Goryachev
On Tue, 1 Apr 2025 20:11:46 GMT, Kevin Rushforth wrote: >> There is more than one way to sk^H^H pet the cat. >> >> We could use a property to disable (or rather, enable) the screenshots, and >> only enable the capture during the debugging session. This will prevent us >> from catching those h

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:55:09 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of the

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 22:09:46 GMT, Andy Goryachev wrote: >> Actually, Safari is the browser which will show the complete screenshot. >> Chrome will only show a truncated screenshot, and I don't have Firefox to >> test. > > I was planning to add a decoding tool to the MonkeyTester anyway. > Actu

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 22:08:09 GMT, Andy Goryachev wrote: >> Although apparently not Chrome. :) > > Actually, Safari is the browser which will show the complete screenshot. > Chrome will only show a truncated screenshot, and I don't have Firefox to > test. I was planning to add a decoding tool t

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:55:09 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of the

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 22:07:22 GMT, Kevin Rushforth wrote: >> tests/system/src/test/java/test/util/ScreenCaptureTestWatcher.java line 45: >> >>> 43: @Override >>> 44: public void testFailed(ExtensionContext extensionContext, Throwable >>> err) { >>> 45: // the data url can be paste

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:51:34 GMT, Kevin Rushforth wrote: >> Andy Goryachev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> stderr > > tests/system/src/test/java/test/util/ScreenCaptureTestWatcher.java line 45: > >> 43: @Override >> 4

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 21:43:41 GMT, Kevin Rushforth wrote: > in a JSON image, you wouldn't have the `""data:image/png;base64,"` prefix? correct, the prefix would be something else, like `takeScreenshotBase64("{screenshot:","}");` - PR Review Comment: https://git.openjdk.org/jfx/pull/1

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:46:02 GMT, Andy Goryachev wrote: >>> We are not ready for JSON logs, I admit, but this was the rationale behind >>> the design of this class: >>> >>> * a low-level method that returns byte[] >>> * a base-64 encoding method that allows for custom prefix/suffix to be able >

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v8]

2025-04-04 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > The log contains a base

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v7]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 21:15:37 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of the

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v7]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:15:37 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of the

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:42:39 GMT, Andy Goryachev wrote: >> One thing that happened recently (in the past 10 years or so) is that JSON >> became a frequently used format for logs. It's not perfect, but it's easy >> to parse. With that, json-oriented log viewers came. >> >> We don't have a cons

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 21:39:32 GMT, Andy Goryachev wrote: >>> hmm, not sure if I share the concern (did I understand the concern?) >>> >>> the idea is to have a low-level method `takeScreenshotBase64(prefix, >>> postfix)` that can be used in non-standard situations, but also provide the >>> conve

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 21:28:59 GMT, Kevin Rushforth wrote: >> hmm, not sure if I share the concern (did I understand the concern?) >> >> the idea is to have a low-level method `takeScreenshotBase64(prefix, >> postfix)` that can be used in non-standard situations, but also provide the >> convenien

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 21:11:19 GMT, Andy Goryachev wrote: > hmm, not sure if I share the concern (did I understand the concern?) > > the idea is to have a low-level method `takeScreenshotBase64(prefix, > postfix)` that can be used in non-standard situations, but also provide the > convenience met

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 21:05:52 GMT, Kevin Rushforth wrote: >> The reason I have prefix and postfix instead of what you are proposing is >> that in my case only one event is written to the output. This might be >> important when both stderr and stdout are redirected to the same log file, >> in wh

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v7]

2025-04-04 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > The log contains a base

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 20:44:23 GMT, Andy Goryachev wrote: > > Maybe add class docs in the utility class > > both classes have code samples to illustrate the usage - maybe insufficient. > any suggestions? No, I just failed to notice it. My fault. - PR Comment: https://git.openjdk.org

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 20:57:06 GMT, Andy Goryachev wrote: >> tests/system/src/test/java/test/util/ScreenshotCapture.java line 93: >> >>> 91: */ >>> 92: public static void writeScreenshot(PrintStream out) { >>> 93: >>> out.println(ScreenshotCapture.takeScreenshotBase64("Screenshot:

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 20:42:03 GMT, Andy Goryachev wrote: >> tests/system/src/test/java/test/util/ScreenshotCapture.java line 60: >> >>> 58: * @throws IOException when an I/O error occurs >>> 59: */ >>> 60: public static byte[] takeScreenshot() throws IOException { >> >> I have no id

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 20:30:55 GMT, Kevin Rushforth wrote: >> Andy Goryachev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> javadoc > > tests/system/src/test/java/test/util/ScreenshotCapture.java line 93: > >> 91: */ >> 92: publi

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 20:28:43 GMT, Kevin Rushforth wrote: >> Andy Goryachev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> javadoc > > tests/system/src/test/java/test/util/ScreenshotCapture.java line 107: > >> 105: * @return the scr

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 20:24:16 GMT, Kevin Rushforth wrote: >> Andy Goryachev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> javadoc > > tests/system/src/test/java/test/util/ScreenshotCapture.java line 60: > >> 58: * @throws IOExcepti

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Andy Goryachev
On Fri, 4 Apr 2025 20:38:08 GMT, Kevin Rushforth wrote: > Maybe add class docs in the utility class both classes have code samples to illustrate the usage - maybe insufficient. any suggestions? - PR Comment: https://git.openjdk.org/jfx/pull/1746#issuecomment-2779696634

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Fri, 4 Apr 2025 20:36:32 GMT, Kevin Rushforth wrote: > One other thing that might be helpful is class docs that describe the two > different ways of using it (the watcher annotation and the direct call to the > utility method). Scratch the first part of this suggestion: the annotation alrea

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-04 Thread Kevin Rushforth
On Wed, 2 Apr 2025 15:04:54 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of the

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-04-04 Thread Kevin Rushforth
On Fri, 28 Mar 2025 18:22:56 GMT, Andy Goryachev wrote: > Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v2]

2025-04-04 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > A possible improvement

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-02 Thread Andy Goryachev
On Tue, 1 Apr 2025 22:42:25 GMT, Kevin Rushforth wrote: >> Turns out one can't intercept assertion exceptions with >> `Thread.setDefaultUncaughtExceptionHandler()` (duh!), so this is likely to >> be a known limitation. >> >> We might still provide general purpose methods in `ScreenCapture` (ne

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v6]

2025-04-02 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > The log contains a base

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v5]

2025-04-02 Thread Andy Goryachev
On Wed, 2 Apr 2025 14:39:46 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of the

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-01 Thread Kevin Rushforth
On Tue, 1 Apr 2025 21:17:35 GMT, Andy Goryachev wrote: > We might still provide general purpose methods in ScreenCapture (new class) > like That might work. So the idea would be a utility class not tied to a JUnit5 annotation? The usage would then be adding a call to that while debugging a te

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v4]

2025-04-01 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > The log contains a base

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-01 Thread Andy Goryachev
On Mon, 31 Mar 2025 18:35:03 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of th

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-01 Thread Andy Goryachev
On Tue, 1 Apr 2025 20:11:13 GMT, Kevin Rushforth wrote: > This suggests that the test watcher doesn't get called until after the > @AfterEach method has run. That's entirely possible. I suppose one can register a Thread::uncaughtExceptionHandler and call a static method, something like Scree

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-01 Thread Andy Goryachev
On Tue, 1 Apr 2025 19:51:16 GMT, Kevin Rushforth 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

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-01 Thread Kevin Rushforth
On Mon, 31 Mar 2025 16:59:31 GMT, Andy Goryachev wrote: >> Hmm. That isn't what I thought we were doing. I thought the idea was to >> annotate most (if not all all) screen capture tests, qualified by a system >> property, enable that property in our CI test runs, so that when we do get >> inte

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-04-01 Thread Kevin Rushforth
On Mon, 31 Mar 2025 18:35:03 GMT, Andy Goryachev wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of th

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-31 Thread Andy Goryachev
On Fri, 28 Mar 2025 21:00:47 GMT, Kevin Rushforth wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of t

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v2]

2025-03-31 Thread Andy Goryachev
On Fri, 28 Mar 2025 21:10:46 GMT, Kevin Rushforth wrote: >> Andy Goryachev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - testing: inject a failure >> - review comments > > tests/system/src/test/java/test/util/ScreenCaptureTestWatche

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v3]

2025-03-31 Thread Andy Goryachev
> Introduce a facility, in the form of JUnit5 annotation, to allow for > capturing a desktop screenshot of a failed test. > > The primary intent is to be able to debug an intermittent test case, rather > than wholesale addition of the new annotation to all the tests. > > A possible improvement

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-31 Thread Andy Goryachev
On Fri, 28 Mar 2025 21:31:45 GMT, Kevin Rushforth wrote: >> tests/system/src/test/java/test/util/ScreenCaptureTestWatcher.java line 77: >> >>> 75: public void testFailed(ExtensionContext extensionContext, Throwable >>> err) { >>> 76: err.printStackTrace(); >>> 77: System.err

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-31 Thread Andy Goryachev
On Fri, 28 Mar 2025 21:04:00 GMT, Kevin Rushforth wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of t

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-31 Thread Kevin Rushforth
On Mon, 31 Mar 2025 14:58:11 GMT, Andy Goryachev wrote: >> tests/system/src/test/java/test/util/ScreenCaptureTestWatcher.java line 47: >> >>> 45: * >>> 46: * This facility takes a screenshot of any failed test, then logs the >>> base64-encoded screenshot >>> 47: * to {@code stderr}. >> >>

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-31 Thread Andy Goryachev
On Fri, 28 Mar 2025 21:07:21 GMT, Kevin Rushforth wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of t

Re: RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-28 Thread Kevin Rushforth
On Fri, 28 Mar 2025 21:21:11 GMT, Kevin Rushforth wrote: >> Introduce a facility, in the form of JUnit5 annotation, to allow for >> capturing a desktop screenshot of a failed test. >> >> The primary intent is to be able to debug an intermittent test case, rather >> than wholesale addition of t

RFR: 8328716: [TestBug] Screen capturing utility for failed tests

2025-03-28 Thread Andy Goryachev
Introduce a facility, in the form of JUnit5 annotation, to allow for capturing a desktop screenshot of a failed test. The primary intent is to be able to debug an intermittent test case, rather than wholesale addition of the new annotation to all the tests. A possible improvement could be to ou