After fixing JDK-8230731 and JDK-8242787, and HeapDumpTestWithActiveProcess.java is removed from the problem list, it sometimes fails with:
java.lang.RuntimeException: Test ERROR java.lang.RuntimeException: 'JShellToolProvider' missing from stdout/stderr
at JShellHeapDumpTest.printStackTraces(JShellHeapDumpTest.java:105)
at JShellHeapDumpTest.testHeapDump(JShellHeapDumpTest.java:122)
at JShellHeapDumpTest.main(JShellHeapDumpTest.java:164)
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:832)
Caused by: java.lang.RuntimeException: 'JShellToolProvider' missing from stdout/stderr
at JShellHeapDumpTest.printStackTraces(JShellHeapDumpTest.java:102)
... 8 more
The reason is because the test is not waiting for the main thread of the spawned jshell process to start up. Thus when the test requests a stack dump, it does not find the JShellToolProvider.
HeapDumpTestWithActiveProcess just uses JShellHeapDumpTest, but passes the "nosleep" argument so JShellHeapDumpTest does not sleep for two seconds upon launch to avoid a myriad of other potential test failures that result when trying to capture the stack dump of an active thread. However, by not delaying it means that sometims the test requests a thread dump before the jshell process has even started or entered them main thread, thus the expected symbol is missing.
The fix is to not require the presence of JShellHeapDumpTest when "nosleep" is specified.