RFR: 8357165: test java/lang/invoke/ClassValueTest.java fails intermittently

Jaikiran Pai jpai at openjdk.org
Wed May 21 11:05:52 UTC 2025


On Sun, 18 May 2025 21:58:04 GMT, Chen Liang <liach at openjdk.org> wrote:

> The test was originally written with product builds in mind; it didn't consider the slowness of debug builds, thus causing tests to fail.
> 
> Also there was a bug in testWeakAgainstClassValue: the test need to flush the backing map in the class to have the weak value removed. It is fixed in this patch as well.
> 
> Testing: ClassValueTest repeated 10 times on windows-x64/linux-x64/macosx-aarch64/linux-aarch64 fastdebug.

Hello Chen, in general for tests like these we don't use any explicit timeout value for waiting on certain condition. It's based on our past experiences in the CI and various other test runtime environments where no timeout value is a "right" timeout and can cause intermittent timeouts like here.

In this test, I think we should just switch to using `await()` and `join()` i.e. no specific timeouts. If there is any bug (either in the test or the product code) and the test doesn't complete, then the jtreg's timeout infrastructure will fail the test and at the same time has the necessary features to collect all necessary details to help debug those unexpected timeout failures.

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

PR Comment: https://git.openjdk.org/jdk/pull/25292#issuecomment-2897532321


More information about the core-libs-dev mailing list