RFR: 8373293: Change the exception handling in TestNestHostErrorWithMultiThread.java

Jaikiran Pai jpai at openjdk.org
Tue Dec 9 02:06:56 UTC 2025


On Tue, 9 Dec 2025 01:28:39 GMT, David Holmes <dholmes at openjdk.org> wrote:

> To prevent the failure mode seen in [JDK-8372988](https://bugs.openjdk.org/browse/JDK-8372988) we should prevent thread test threads from being terminated by uncaught exceptions, and allow the main thread to detect and throw all errors. That way we should see what the actual failure is.
> 
> Testing:
>  - tiers 1-4 (sanity)
> 
> Thanks

I don't have prior knowledge of this test, but this refactoring/cleanup in context of this test failure looks good to me.

test/hotspot/jtreg/runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java line 68:

> 66:       }
> 67:     } catch (InterruptedException e) {
> 68:       throw new Error("Unexpected interrupt");

Hello David, while at it, it might be good to even include the `e` as the `cause` of this `Error`. That way we get to see which `join()` line in that try block resulted in the `InterruptedException`.

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

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28713#pullrequestreview-3554931609
PR Review Comment: https://git.openjdk.org/jdk/pull/28713#discussion_r2600785891


More information about the hotspot-runtime-dev mailing list