8231097: [TESTBUG] runtime/cds/appcds/DirClasspathTest.java can fail with a mapping error
authorccheung
Tue, 24 Sep 2019 20:16:13 -0700
changeset 58310 81134def991d
parent 58309 c6f8b2c3dc66
child 58311 88fce7eea1f6
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
test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java
--- 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");