On Fri, 19 Sep 2025 15:41:27 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> This PR removes unrelated `stderr` output in the headless test logs by >> redirecting it to an in-memory buffer. Exceptions found in the buffer can >> be checked against the expected list. >> >> In the case when any mismatch is detected, whether the type or the number of >> exceptions of particular type, the accumulated buffer gets dumped to >> `stderr` and the test fails. >> >> ## How To >> >> To redirect stderr and later check the exceptions, surround your code with >> >> `OutputRedirect.suppressStderr()` and either `OutputRedirect.checkStderr()` >> or `OutputRedirect.checkAndRestoreStderr()` (ideally, in the `finally` >> block). >> >> To simply undo redirection, without checking, call >> `OutputRedirect.restoreStderr()`. >> >> To add the check to all the tests in the file, one can call the above >> mentioned methods inside `@BeforeEach` and `@AfterEach`. >> >> ## Changes >> >> - added `OutputRedirect` facility >> >> ## Miscellaneous >> >> `ErrorLoggingUtiltity` name will be fixed in a followup >> https://bugs.openjdk.org/browse/JDK-8367995 > > Andy Goryachev has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains 30 additional > commits since the last revision: > > - throws > - Merge remote-tracking branch 'origin/master' into 8336332.failed > - revert snapshot 1 test > - run and wait > - review comments > - static > - review comments > - cleanup > - reverted renaming > - snapshot 1 test > - ... and 20 more: https://git.openjdk.org/jfx/compare/01a8785a...3d900495 LGTM+, The log looks good now. ------------- PR Review: https://git.openjdk.org/jfx/pull/1897#pullrequestreview-3258823334