RFR: 8294155: Exception thrown before awaitAndCheck hangs PassFailJFrame

Alexander Zuev kizune at openjdk.org
Wed Feb 12 09:54:10 UTC 2025


On Tue, 11 Feb 2025 16:17:13 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> If a manual test throws an exception during construction of `PassFailJFrame`, the test execution hangs. When the builder pattern is used, no UI appears on the screens, but the Java process does not terminate automatically because there are windows which prevent AWT from shutting down.
> 
> **Fix:**
> 
> Catch exceptions in `PassFailJFrame.Builder.build()` and dispose of all the windows if an exception occurs.
> 
> This ensures all the created windows are disposed of, which lets AWT shut down cleanly.
> 
> _Note:_ the above problem doesn't occur when the test is run with `jtreg` because jtreg shuts down the JVM as soon as the main thread exits.

Marked as reviewed by kizune (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/23564#pullrequestreview-2611369216


More information about the client-libs-dev mailing list