Skip to content

Commit c85075b

Browse files
committed
8231367: [TESTBUG] ParallelLoadTest.java fails with "test.dynamic.dump not supported"
Reviewed-by: ccheung
1 parent 0812854 commit c85075b

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

test/hotspot/jtreg/runtime/cds/appcds/ParallelLoadTest.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* @run driver ParallelLoadTest
3434
*/
3535

36+
import java.io.File;
37+
3638
public class ParallelLoadTest {
3739
public static final int MAX_CLASSES = 40;
3840

@@ -47,39 +49,36 @@ public class ParallelLoadTest {
4749
private static final int BOOT_LOOPS = Integer.parseInt(System.getProperty("ParallelLoadTest.boot.loops", "1"));
4850

4951
public static void main(String[] args) throws Exception {
50-
JarBuilder.build("parallel_load", getClassList(true));
51-
String testJar = TestCommon.getTestJar("parallel_load.jar");
52+
JarBuilder.build("parallel_load_app", "ParallelLoad", "ParallelLoadThread", "ParallelLoadWatchdog");
53+
JarBuilder.build("parallel_load_classes", getClassList());
54+
String appJar = TestCommon.getTestJar("parallel_load_app.jar");
55+
String classesJar = TestCommon.getTestJar("parallel_load_classes.jar");
5256

5357
// (1) Load the classes from app class loader
54-
TestCommon.testDump(testJar, getClassList(false));
58+
String CP = appJar + File.pathSeparator + classesJar;
59+
TestCommon.testDump(CP, getClassList());
5560
for (int i = 0; i < APP_LOOPS; i++) {
56-
TestCommon.run("-cp", testJar, "ParallelLoad").assertNormalExit();
61+
TestCommon.run("-cp", CP, "ParallelLoad").assertNormalExit();
5762
}
5863

5964
// (2) Load the classes from boot class loader
60-
String bootcp = "-Xbootclasspath/a:" + testJar;
61-
TestCommon.testDump(null, getClassList(false), bootcp);
65+
String bootcp = "-Xbootclasspath/a:" + classesJar;
66+
TestCommon.testDump(appJar, getClassList(), bootcp);
6267
for (int i = 0; i < BOOT_LOOPS; i++) {
63-
TestCommon.run(bootcp,
68+
TestCommon.run(bootcp, "-cp", appJar,
6469
// "-Xlog:class+load=debug",
6570
"ParallelLoad").assertNormalExit();
6671
}
6772
}
6873

69-
private static String[] getClassList(boolean includeWatchdog) {
70-
int extra = includeWatchdog ? 3 : 2;
71-
String[] classList = new String[MAX_CLASSES + extra];
74+
private static String[] getClassList() {
75+
String[] classList = new String[MAX_CLASSES];
7276

7377
int i;
7478
for (i = 0; i < MAX_CLASSES; i++) {
7579
classList[i] = "ParallelClass" + i;
7680
}
7781

78-
classList[i++] = "ParallelLoad";
79-
classList[i++] = "ParallelLoadThread";
80-
if (includeWatchdog)
81-
classList[i++] = "ParallelLoadWatchdog";
82-
8382
return classList;
8483
}
8584
}

test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public static OutputAnalyzer createArchive(AppCDSOptions opts)
218218
if (!mainModuleSpecified && !patchModuleSpecified) {
219219
// If you have an empty classpath, you cannot specify a classlist!
220220
if (opts.classList != null && opts.classList.length > 0) {
221-
throw new RuntimeException("test.dynamic.dump not supported empty classpath with non-empty classlist");
221+
throw new RuntimeException("test.dynamic.dump is not supported with an empty classpath while the classlist is not empty");
222222
}
223223
cmd.add("-version");
224224
}

0 commit comments

Comments
 (0)