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. ------------- Commit messages: - Restore incorrectly removed annotation - Fix problems with class value tests Changes: https://git.openjdk.org/jdk/pull/25292/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25292&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357165 Stats: 14 lines in 1 file changed: 5 ins; 6 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25292.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25292/head:pull/25292 PR: https://git.openjdk.org/jdk/pull/25292