RFR: 8358633 : Test ThreadPoolExecutorTest::testTimedInvokeAnyNullTimeUnit is broken by JDK-8347491

Alan Bateman alanb at openjdk.org
Thu Jun 5 09:16:55 UTC 2025


On Thu, 5 Jun 2025 08:12:29 GMT, David Holmes <dholmes at openjdk.org> wrote:

> It is far too easy to have a test "pass" because it catches the wrong instance of a thrown exception and hide an underlying problem.

OmitStackTraceInFastThrow is enabled by default so possible for C2 to compile this to throw a pre-allocated exception with no message detail or stack trace. This is what is happening with these -Xcomp runs so the detail message is null rather than the expected message. An explicit test with Objects.requireNonNull would likely dodge this but does seem fragile.

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

PR Comment: https://git.openjdk.org/jdk/pull/25655#issuecomment-2943390680


More information about the core-libs-dev mailing list