From 534d2b33dc23d0171fdce3cb89d679d5088b4667 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Tue, 1 Jul 2025 19:52:06 +0000 Subject: [PATCH] 8357064: cds/appcds/ArchiveRelocationTest.java failed with missing expected output Reviewed-by: shade, iklam --- .../jtreg/runtime/cds/appcds/ArchiveRelocationTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/runtime/cds/appcds/ArchiveRelocationTest.java b/test/hotspot/jtreg/runtime/cds/appcds/ArchiveRelocationTest.java index 21a43fcf9cb..b433458a059 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/ArchiveRelocationTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/ArchiveRelocationTest.java @@ -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"); }