8231097: [TESTBUG] runtime/cds/appcds/DirClasspathTest.java can fail with a mapping error
Summary: Check output for mapping failure and throw a SkippedException.
Reviewed-by: iklam, dholmes
--- a/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java Tue Sep 24 18:25:54 2019 -0700
+++ b/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java Tue Sep 24 20:16:13 2019 -0700
@@ -242,7 +242,12 @@
if (opts.appJarDir != null) {
pb.directory(new File(opts.appJarDir));
}
- return executeAndLog(pb, "dump");
+
+ OutputAnalyzer output = executeAndLog(pb, "dump");
+ if (DYNAMIC_DUMP && isUnableToMap(output)) {
+ throw new SkippedException(UnableToMapMsg);
+ }
+ return output;
}
// This allows you to run the AppCDS tests with JFR enabled at runtime (though not at
@@ -462,9 +467,6 @@
String... suffix) throws Exception {
OutputAnalyzer output = dump(appJar, classList, suffix);
if (DYNAMIC_DUMP) {
- if (isUnableToMap(output)) {
- throw new SkippedException(UnableToMapMsg);
- }
output.shouldContain("Written dynamic archive");
} else {
output.shouldContain("Loading classes to share");
@@ -477,9 +479,6 @@
String... suffix) throws Exception {
OutputAnalyzer output = dump(appJarDir, appJar, classList, suffix);
if (DYNAMIC_DUMP) {
- if (isUnableToMap(output)) {
- throw new SkippedException(UnableToMapMsg);
- }
output.shouldContain("Written dynamic archive");
} else {
output.shouldContain("Loading classes to share");