8357064: cds/appcds/ArchiveRelocationTest.java failed with missing expected output

Reviewed-by: shade, iklam
This commit is contained in:
Calvin Cheung 2025-07-01 19:52:06 +00:00
parent e9a62d79cd
commit 534d2b33dc

View File

@ -67,6 +67,8 @@ public class ArchiveRelocationTest {
String logArg = "-Xlog:cds=debug,cds+reloc=debug,aot+heap";
String unlockArg = "-XX:+UnlockDiagnosticVMOptions";
String nmtArg = "-XX:NativeMemoryTracking=detail";
String relocMsg1 = "ArchiveRelocationMode == 1: always map archive(s) at an alternative address";
String relocMsg2 = "Try to map archive(s) at an alternative address";
OutputAnalyzer out = TestCommon.dump(appJar,
TestCommon.list(mainClass),
@ -76,8 +78,10 @@ public class ArchiveRelocationTest {
TestCommon.run("-cp", appJar, unlockArg, runRelocArg, logArg, mainClass)
.assertNormalExit(output -> {
if (run_reloc) {
output.shouldContain("ArchiveRelocationMode == 1: always map archive(s) at an alternative address")
.shouldContain("Try to map archive(s) at an alternative address");
if (!output.contains(relocMsg1) && !output.contains(relocMsg2)) {
throw new RuntimeException("Relocation messages \"" + relocMsg1 +
"\" and \"" + relocMsg2 + "\" are missing from the output");
}
} else {
output.shouldContain("ArchiveRelocationMode: 0");
}