8356102: TestJcmdOutput, JcmdWithNMTDisabled and DumpSharedDictionary hs/tier1 tests fail on static-jdk

Reviewed-by: dholmes
This commit is contained in:
Jiangli Zhou 2025-05-14 14:58:29 +00:00
parent 97b0dd2167
commit 1afd887b13
3 changed files with 9 additions and 5 deletions

View File

@ -53,6 +53,7 @@ public class TestJcmdOutput {
System.out.println("Verify jcmd error message and that jcmd does not write errors to the target process output");
output = new OutputAnalyzer((ProcessTools.createLimitedTestJavaProcessBuilder(
"-Dtest.jdk=" + System.getProperty("test.jdk"),
"-Dcompile.jdk=" + System.getProperty("compile.jdk"),
"-XX:MinHeapFreeRatio=20", "-XX:MaxHeapFreeRatio=80", runJcmd.class.getName())).start());
output.shouldHaveExitValue(0);

View File

@ -48,16 +48,20 @@ public class JcmdWithNMTDisabled {
ProcessBuilder pb;
OutputAnalyzer output;
String testjdkPath = System.getProperty("test.jdk");
String compilejdkPath = System.getProperty("compile.jdk");
// First run without enabling NMT (not in debug, where NMT is by default on)
if (!Platform.isDebugBuild()) {
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "JcmdWithNMTDisabled");
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
"-Dtest.jdk=" + testjdkPath, "-Dcompile.jdk=" + compilejdkPath, "JcmdWithNMTDisabled");
output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
}
// Then run with explicitly disabling NMT, should not be any difference
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Dtest.jdk=" + testjdkPath, "-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled");
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
"-Dtest.jdk=" + testjdkPath, "-Dcompile.jdk=" + compilejdkPath,
"-XX:NativeMemoryTracking=off", "JcmdWithNMTDisabled");
output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);

View File

@ -44,12 +44,11 @@ public class DumpSharedDictionary {
.setArchiveName("./DumpSharedDictionary.jsa");
CDSTestUtils.createArchiveAndCheck(opts);
String testjdkPath = System.getProperty("test.jdk");
opts = (new CDSOptions())
.setUseVersion(false)
.addSuffix("-XX:SharedArchiveFile=./DumpSharedDictionary.jsa",
"-Dtest.jdk=" + testjdkPath,
"-Dtest.jdk=" + System.getProperty("test.jdk"),
"-Dcompile.jdk=" + System.getProperty("compile.jdk"),
"DumpSharedDictionary", "test");
CDSTestUtils.run(opts)
.assertNormalExit();