JDK-8231340 : java/lang/reflect/callerCache/ReflectionCallerCacheTest.java failed with "java.lang.AssertionError: failed to satisfy condition"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 14,17
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2019-09-23
  • Updated: 2021-04-28
  • Resolved: 2021-04-28
Related Reports
Duplicate :  
Relates :  
Relates :  
Sub Tasks
JDK-8261851 :  
Description
# java/lang/reflect/callerCache/ReflectionCallerCacheTest.java

Exception: java.lang.AssertionError: failed to satisfy condition
Exception: java.lang.Exception: failures: ...


# Extracts from attached log
.........
#section:build
----------messages:(3/108)----------
command: build ReflectionCallerCacheTest
reason: Named class compiled on demand
elapsed time (seconds): 0.0
result: Passed. All files up to date
#section:testng
----------messages:(5/246)----------
command: testng ReflectionCallerCacheTest
reason: User specified action: run testng/othervm ReflectionCallerCacheTest 
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules jdk.compiler
elapsed time (seconds): 88.462
----------configuration:(3/40)----------
Boot Layer
  add modules: jdk.compiler
----------System.out:(54/3529)----------
[TestNG] Running:
  java/lang/reflect/callerCache/ReflectionCallerCacheTest.java
config ReflectionCallerCacheTest.setup(): success
test ReflectionCallerCacheTest.load("AccessTest$PublicConstructor"): success
test ReflectionCallerCacheTest.load("AccessTest$PublicMethod"): success
test ReflectionCallerCacheTest.load("AccessTest$PublicField"): success
test ReflectionCallerCacheTest.load("AccessTest$ProtectedMethod"): success
test ReflectionCallerCacheTest.load("AccessTest$ProtectedField"): success
test ReflectionCallerCacheTest.load("AccessTest$PrivateMethod"): failure
java.lang.AssertionError: failed to satisfy condition
	at ReflectionCallerCacheTest$ForceGC.await(ReflectionCallerCacheTest.java:174)
	at ReflectionCallerCacheTest.load(ReflectionCallerCacheTest.java:113)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:773)
	at org.testng.TestRunner.run(TestRunner.java:623)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
	at org.testng.TestNG.run(TestNG.java:1018)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:830)
test ReflectionCallerCacheTest.load("AccessTest$PrivateField"): success
test ReflectionCallerCacheTest.load("AccessTest$PublicFinalField"): success
test ReflectionCallerCacheTest.load("AccessTest$PrivateFinalField"): success
test ReflectionCallerCacheTest.load("AccessTest$PublicStaticFinalField"): success
test ReflectionCallerCacheTest.load("AccessTest$PrivateStaticFinalField"): success
test ReflectionCallerCacheTest.load("AccessTest$NewInstance"): success
===============================================
java/lang/reflect/callerCache/ReflectionCallerCacheTest.java
Total tests run: 12, Failures: 1, Skips: 0
===============================================
----------System.err:(16/1070)----------
Note: /scratch/mesos/jib-master/install/jdk-14+16-634/src.full/open/test/jdk/java/lang/reflect/callerCache/AccessTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
java.lang.Exception: failures: 1
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:830)
JavaTest Message: Test threw exception: java.lang.Exception: failures: 1
JavaTest Message: shutting down test
STATUS:Failed.`main' threw exception: java.lang.Exception: failures: 1

Comments
It has been some time since JDK-8261851 was integrated and ReflectionCallerCacheTest.java has been passing. This issue can be closed.
28-04-2021

This test should use ForceGC from test library which has additional instrumentation for diagnosing test issue. In addition it will get the fix for JDK-8258007. Will look into it once JDK-8261851 is resolved if the test failure is reproduced.
16-02-2021

Here's a snippet from the log file for the jdk-17+10-700-tier8 sighting: ----------System.out:(54/3583)---------- [TestNG] Running: java/lang/reflect/callerCache/ReflectionCallerCacheTest.java config ReflectionCallerCacheTest.setup(): success test ReflectionCallerCacheTest.load("AccessTest$PublicConstructor"): success test ReflectionCallerCacheTest.load("AccessTest$PublicMethod"): success test ReflectionCallerCacheTest.load("AccessTest$PublicField"): success test ReflectionCallerCacheTest.load("AccessTest$ProtectedMethod"): success test ReflectionCallerCacheTest.load("AccessTest$ProtectedField"): success test ReflectionCallerCacheTest.load("AccessTest$PrivateMethod"): failure java.lang.AssertionError: failed to satisfy condition at ReflectionCallerCacheTest$ForceGC.await(ReflectionCallerCacheTest.java:174) at ReflectionCallerCacheTest.load(ReflectionCallerCacheTest.java:113) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:831) test ReflectionCallerCacheTest.load("AccessTest$PrivateField"): success test ReflectionCallerCacheTest.load("AccessTest$PublicFinalField"): success test ReflectionCallerCacheTest.load("AccessTest$PrivateFinalField"): success test ReflectionCallerCacheTest.load("AccessTest$PublicStaticFinalField"): success test ReflectionCallerCacheTest.load("AccessTest$PrivateStaticFinalField"): success test ReflectionCallerCacheTest.load("AccessTest$NewInstance"): success =============================================== java/lang/reflect/callerCache/ReflectionCallerCacheTest.java Total tests run: 12, Failures: 1, Skips: 0 =============================================== ----------System.err:(16/1108)*---------- Note: C:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-17+10-700\\src.full\\open\\test\\jdk\\java\\lang\\reflect\\callerCache\\AccessTest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. java.lang.Exception: failures: 1 at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:831) JavaTest Message: Test threw exception: java.lang.Exception: failures: 1 JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.Exception: failures: 1 ----------rerun:(54/6265)*----------
14-02-2021

The test failure seems to be similar to JDK-8229253 but no intermittent failure has observed since this issue was reported. I'm closing this as cannot reproduce.
04-12-2020