RFR: 8294155: Exception thrown before awaitAndCheck hangs PassFailJFrame
Sergey Bylokhov
serb at openjdk.org
Tue Feb 11 19:05:20 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 serb (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/23564#pullrequestreview-2609757809
More information about the client-libs-dev
mailing list