Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 9f86d94

Browse files
committedMay 6, 2020
8244491: make runtime/cds/appcds/TestZGCWithCDS.java test more robust
Reviewed-by: dholmes
1 parent 5e83cb6 commit 9f86d94

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed
 

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

+10-26
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @requires vm.cds
2727
* @requires vm.bits == 64
2828
* @requires vm.gc.Z
29-
* @comment assuming that default GC supports both UseCompressedOops and UseCompressedClassPointers
29+
* @requires vm.gc.Serial
3030
* @requires vm.gc == null
3131
* @comment Graal does not support ZGC
3232
* @requires !vm.graal.enabled
@@ -44,7 +44,6 @@ public class TestZGCWithCDS {
4444
public final static String ERR_MSG = "The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled.";
4545
public static void main(String... args) throws Exception {
4646
String helloJar = JarBuilder.build("hello", "Hello");
47-
// 0. dump with ZGC
4847
System.out.println("0. Dump with ZGC");
4948
OutputAnalyzer out = TestCommon
5049
.dump(helloJar,
@@ -54,7 +53,6 @@ public static void main(String... args) throws Exception {
5453
out.shouldContain("Dumping shared data to file:");
5554
out.shouldHaveExitValue(0);
5655

57-
// 1. Run with same args of dump
5856
System.out.println("1. Run with same args of dump");
5957
out = TestCommon
6058
.exec(helloJar,
@@ -64,34 +62,21 @@ public static void main(String... args) throws Exception {
6462
out.shouldContain(HELLO);
6563
out.shouldHaveExitValue(0);
6664

67-
// 2. Run with ZGC turned off
68-
System.out.println("2. Run with ZGC turned off");
69-
out = TestCommon
70-
.exec(helloJar,
71-
"-XX:-UseZGC",
72-
"-XX:+UseCompressedOops", // in case turned off by vmoptions
73-
"-XX:+UseCompressedClassPointers", // by jtreg
74-
"-Xlog:cds",
75-
"Hello");
76-
out.shouldContain(UNABLE_TO_USE_ARCHIVE);
77-
out.shouldContain(ERR_MSG);
78-
out.shouldHaveExitValue(1);
79-
80-
// 3. Run with -UseCompressedOops -UseCompressedClassPointers
81-
System.out.println("3. Run with -UseCompressedOops -UseCompressedClassPointers");
65+
System.out.println("2. Run with -UseCompressedOops -UseCompressedClassPointers");
8266
out = TestCommon
8367
.exec(helloJar,
68+
"-XX:+UseSerialGC",
8469
"-XX:-UseCompressedOops",
8570
"-XX:-UseCompressedClassPointers",
8671
"-Xlog:cds",
8772
"Hello");
8873
out.shouldContain(HELLO);
8974
out.shouldHaveExitValue(0);
9075

91-
// 4. Run with +UseCompressedOops -UseCompressedClassPointers
92-
System.out.println("4. Run with +UseCompressedOops -UseCompressedClassPointers");
76+
System.out.println("3. Run with +UseCompressedOops -UseCompressedClassPointers");
9377
out = TestCommon
9478
.exec(helloJar,
79+
"-XX:+UseSerialGC",
9580
"-XX:+UseCompressedOops",
9681
"-XX:-UseCompressedClassPointers",
9782
"-Xlog:cds",
@@ -100,10 +85,10 @@ public static void main(String... args) throws Exception {
10085
out.shouldContain(ERR_MSG);
10186
out.shouldHaveExitValue(1);
10287

103-
// 5. Run with +UseCompressedOops +UseCompressedClassPointers
104-
System.out.println("5. Run with +UseCompressedOops +UseCompressedClassPointers");
88+
System.out.println("4. Run with +UseCompressedOops +UseCompressedClassPointers");
10589
out = TestCommon
10690
.exec(helloJar,
91+
"-XX:+UseSerialGC",
10792
"-XX:+UseCompressedOops",
10893
"-XX:+UseCompressedClassPointers",
10994
"-Xlog:cds",
@@ -112,19 +97,18 @@ public static void main(String... args) throws Exception {
11297
out.shouldContain(ERR_MSG);
11398
out.shouldHaveExitValue(1);
11499

115-
// 6. dump with -UseCompressedOops -UseCompressedClassPointers
116-
System.out.println("6. Dump with -UseCompressedOops -UseCompressedClassPointers");
100+
System.out.println("5. Dump with -UseCompressedOops -UseCompressedClassPointers");
117101
out = TestCommon
118102
.dump(helloJar,
119103
new String[] {"Hello"},
104+
"-XX:+UseSerialGC",
120105
"-XX:-UseCompressedOops",
121106
"-XX:-UseCompressedClassPointers",
122107
"-Xlog:cds");
123108
out.shouldContain("Dumping shared data to file:");
124109
out.shouldHaveExitValue(0);
125110

126-
// 7. Run with ZGC
127-
System.out.println("7. Run with ZGC");
111+
System.out.println("6. Run with ZGC");
128112
out = TestCommon
129113
.exec(helloJar,
130114
"-XX:+UseZGC",

0 commit comments

Comments
 (0)