Skip to content

Commit b0496b0

Browse files
committedJan 19, 2022
8279970: two AppCDS tests fail after JDK-8261455
Reviewed-by: ccheung, iklam
1 parent 4eb4f94 commit b0496b0

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed
 

‎test/hotspot/jtreg/ProblemList.txt

-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64
103103
runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64
104104
runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64
105105
runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64
106-
runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java 8279970 generic-all
107-
runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#custom-cl-zgc 8279970 generic-all
108106

109107
applications/jcstress/copy.java 8229852 linux-all
110108

‎test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class DynamicArchiveTestBase {
3838
private static boolean executedIn_run = false;
3939
private static boolean autoMode = false; // -Xshare:auto
4040
private static final WhiteBox WB = WhiteBox.getWhiteBox();
41+
private static String[] baseArchiveOptions = new String[] {};
4142

4243
public static interface DynamicArchiveTest {
4344
public void run() throws Exception;
@@ -95,6 +96,10 @@ public static String getNewArchiveName(String stem) {
9596
return TestCommon.getNewArchiveName(stem);
9697
}
9798

99+
public static void setBaseArchiveOptions(String... opts) {
100+
baseArchiveOptions = opts;
101+
}
102+
98103
/**
99104
* Excute a JVM to dump a base archive by
100105
* -Xshare:dump -XX:SharedArchiveFile=baseArchiveName
@@ -286,7 +291,7 @@ public static void dumpAndRun(String topArchiveName, String ... cmdLineSuffix) t
286291
private static String getTempBaseArchive() throws Exception {
287292
if (tempBaseArchive == null) {
288293
tempBaseArchive = getNewArchiveName("tempBaseArchive");
289-
TestCommon.dumpBaseArchive(tempBaseArchive);
294+
TestCommon.dumpBaseArchive(tempBaseArchive, baseArchiveOptions);
290295
}
291296
return tempBaseArchive;
292297
}

‎test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101

102102
import java.io.IOException;
103103
import java.io.File;
104-
105104
import java.nio.file.attribute.FileTime;
106105
import java.nio.file.Files;
107106
import java.nio.file.Paths;
@@ -111,6 +110,8 @@
111110
import jdk.test.lib.process.OutputAnalyzer;
112111
import jdk.test.lib.helpers.ClassFileInstaller;
113112

113+
import jtreg.SkippedException;
114+
114115
public class TestAutoCreateSharedArchive extends DynamicArchiveTestBase {
115116
private static final String BASE_NAME = CDSTestUtils.getOutputFileName("base.jsa");
116117
private static final String TOP_NAME = CDSTestUtils.getOutputFileName("top.jsa");
@@ -123,6 +124,9 @@ public class TestAutoCreateSharedArchive extends DynamicArchiveTestBase {
123124
private static int currentCDSVersion = CDSArchiveUtils.getCurrentCDSArchiveVersion();
124125

125126
public static void main(String[] args) throws Exception {
127+
if (isUseSharedSpacesDisabled()) {
128+
throw new SkippedException("Skipped -- This test is not applicable when JTREG tests are executed with -Xshare:off, or if the JDK doesn't have a default archive.");
129+
}
126130
if (args.length != 1 || (!args[0].equals("verifySharedSpacesOff") && !args[0].equals("verifySharedSpacesOn"))) {
127131
throw new RuntimeException("Must run with verifySharedSpacesOff or verifySharedSpacesOn");
128132
}

‎test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@ static void doTest() throws Exception {
130130
static void doTest(boolean errorInDump) throws Exception {
131131
for (int i = 1; i <= 3; i++) {
132132
System.out.println("========================================");
133-
System.out.println("errorInDump: " + errorInDump + ", useCustomLoader: " + useCustomLoader + ", case: " + i);
133+
System.out.println("errorInDump: " + errorInDump + ", useCustomLoader: " + useCustomLoader + ", useZGC: " + useZGC + ", case: " + i);
134134
System.out.println("========================================");
135135
String topArchiveName = getNewArchiveName();
136136
String testCase = Integer.toString(i);
@@ -148,6 +148,7 @@ static void doTest(boolean errorInDump) throws Exception {
148148
cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
149149
"-XX:+UseZGC", "-XX:ZCollectionInterval=0.01",
150150
loaderMainClass, appJar);
151+
setBaseArchiveOptions("-XX:+UseZGC", "-Xlog:cds");
151152
} else {
152153
cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
153154
loaderMainClass, appJar);

0 commit comments

Comments
 (0)
Please sign in to comment.