Skip to content

Commit ce1a09f

Browse files
author
duke
committedOct 7, 2021
Automatic merge of jdk:master into master
2 parents e335ecd + 722d639 commit ce1a09f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎test/hotspot/jtreg/runtime/cds/appcds/TestSerialGCWithCDS.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ static void test(boolean dumpWithSerial, boolean execWithSerial, boolean useSmal
9797
// a small SerialGC heap that may be too small.
9898
String[] sizes = {
9999
"4m", // usually this will success load the archived heap
100-
"2m", // usually this will fail to loade th archived heap, but app can launch
100+
"2m", // usually this will fail to load the archived heap, but app can launch
101+
// or fail with "GC triggered before VM initialization completed"
101102
"1m" // usually this will cause VM launch to fail with "Too small maximum heap"
102103
};
103104
for (String sz : sizes) {
@@ -113,7 +114,12 @@ static void test(boolean dumpWithSerial, boolean execWithSerial, boolean useSmal
113114
if (out.getExitValue() == 0) {
114115
out.shouldContain(HELLO);
115116
} else {
116-
out.shouldContain("Too small maximum heap");
117+
String output = out.getStdout() + out.getStderr();
118+
String exp1 = "Too small maximum heap";
119+
String exp2 = "GC triggered before VM initialization completed";
120+
if (!output.contains(exp1) && !output.contains(exp2)) {
121+
throw new RuntimeException("Either '" + exp1 + "' or '" + exp2 + "' must be in stdout/stderr \n");
122+
}
117123
}
118124
n++;
119125
}

0 commit comments

Comments
 (0)
Please sign in to comment.