8380750: Test runtime/cds/appcds/TestSerialGCWithCDS.java#id1 failed: StringIndexOutOfBoundsException

Reviewed-by: coleenp, iklam
This commit is contained in:
Matias Saavedra Silva 2026-06-30 15:28:53 +00:00
parent fa2ca3d087
commit 45d3532a2c
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ public class TestCDSVMCrash {
throw new Error("Expected VM to crash");
} catch(RuntimeException e) {
if (!e.getMessage().contains("A fatal error has been detected")) {
throw new Error("Expected message: A fatal error has been detected");
throw new Error("Expected message: A fatal error has been detected. Instead message is: " + e.getMessage());
}
}
System.out.println("PASSED");

View File

@ -703,7 +703,7 @@ public class CDSTestUtils {
static String getCrashMessage(String stdOut) {
int start = stdOut.indexOf("# A fatal error has been detected by the Java Runtime Environment:");
int end = stdOut.indexOf(".log", start) + 4;
int end = stdOut.indexOf("# JRE version", start);
return stdOut.substring(start, end);
}