8208705: [TESTBUG] The -Xlog:cds,cds+hashtables vm option is not always required for appcds tests
authorccheung
Thu, 09 Aug 2018 15:52:23 -0700
changeset 51370 fbb62267e5e9
parent 51369 f32e61253792
child 51371 3ab8b84e93cd
8208705: [TESTBUG] The -Xlog:cds,cds+hashtables vm option is not always required for appcds tests Summary: only include the CDS logging option in the tests which require it Reviewed-by: mseledtsov, jiangli, iklam
test/hotspot/jtreg/runtime/appcds/ExtraSymbols.java
test/hotspot/jtreg/runtime/appcds/TestCommon.java
test/hotspot/jtreg/runtime/appcds/VerifierTest.java
test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatBase.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java
--- a/test/hotspot/jtreg/runtime/appcds/ExtraSymbols.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/ExtraSymbols.java	Thu Aug 09 15:52:23 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,17 +38,19 @@
 import jdk.test.lib.process.OutputAnalyzer;
 
 public class ExtraSymbols {
+    static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables";
     public static void main(String[] args) throws Exception {
         String appJar = JarBuilder.getOrCreateHelloJar();
 
         // 1. Dump without extra symbols.
-        OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list("Hello"));
+        OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list("Hello"),
+                                                CDS_LOGGING);
         checkOutput(output);
         int numEntries1 = numOfEntries(output);
 
         // 2. Dump an archive with extra symbols. All symbols in
         // ExtraSymbols.symbols.txt are valid. Dumping should succeed.
-        output = TestCommon.dump(appJar, TestCommon.list("Hello"),
+        output = TestCommon.dump(appJar, TestCommon.list("Hello"), CDS_LOGGING,
             "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("ExtraSymbols.symbols.txt"));
         checkOutput(output);
         int numEntries2 = numOfEntries(output);
--- a/test/hotspot/jtreg/runtime/appcds/TestCommon.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/TestCommon.java	Thu Aug 09 15:52:23 2018 -0700
@@ -133,7 +133,6 @@
         }
 
         cmd.add("-Xshare:dump");
-        cmd.add("-Xlog:cds,cds+hashtables");
         cmd.add("-XX:ExtraSharedClassListFile=" + classList.getPath());
 
         if (opts.archiveName == null)
--- a/test/hotspot/jtreg/runtime/appcds/VerifierTest.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/VerifierTest.java	Thu Aug 09 15:52:23 2018 -0700
@@ -48,6 +48,7 @@
     static final String PASS_RESULT = "Hi, how are you?";
     static final String VFY_INFO_MESSAGE =
         "All non-system classes will be verified (-Xverify:remote) during CDS dump time.";
+    static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables";
 
     enum Testset1Part {
         A, B
@@ -104,6 +105,7 @@
         // Dumping should fail if the IgnoreUnverifiableClassesDuringDump
         // option is not enabled.
         OutputAnalyzer output = TestCommon.dump(jar, appClasses,
+                            CDS_LOGGING,
                             "-XX:+UnlockDiagnosticVMOptions",
                             "-XX:-IgnoreUnverifiableClassesDuringDump");
         output.shouldContain("Please remove the unverifiable classes");
@@ -186,6 +188,7 @@
             if (!dump_setting.equals(prev_dump_setting)) {
                 OutputAnalyzer dumpOutput = TestCommon.dump(
                                                             jar, dump_list, dump_setting,
+                                                            CDS_LOGGING,
                                                             // FIXME: the following options are for working around a GC
                                                             // issue - assert failure when dumping archive with the -Xverify:all
                                                             "-Xms256m",
@@ -243,6 +246,7 @@
             if (!dump_setting.equals(prev_dump_setting)) {
                 OutputAnalyzer dumpOutput = TestCommon.dump(
                                                             jar, appClasses, dump_setting,
+                                                            CDS_LOGGING,
                                                             // FIXME: the following options are for working around a GC
                                                             // issue - assert failure when dumping archive with the -Xverify:all
                                                             "-Xms256m",
--- a/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatBase.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/customLoader/ClassListFormatBase.java	Thu Aug 09 15:52:23 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@
         System.out.println("------------------------------");
 
         try {
-            OutputAnalyzer output = TestCommon.dump(appJar, appClasses);
+            OutputAnalyzer output = TestCommon.dump(appJar, appClasses, "-Xlog:cds");
             output.shouldHaveExitValue(0);
             output.shouldContain("Dumping");
             for (String s : expected_msgs) {
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/ExerciseGC.java	Thu Aug 09 15:52:23 2018 -0700
@@ -41,7 +41,7 @@
         SharedStringsUtils.buildJarAndWhiteBox("HelloStringGC");
 
         SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("HelloStringGC"),
-            "SharedStringsBasic.txt");
+            "SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables");
 
         SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringGC",
             "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeGC");
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java	Thu Aug 09 15:52:23 2018 -0700
@@ -55,7 +55,7 @@
         SharedStringsUtils.buildJar("HelloString");
 
         SharedStringsUtils.dump(TestCommon.list("HelloString"),
-            "SharedStringsBasic.txt");
+            "SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables");
 
         SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC");
 
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Thu Aug 09 15:52:23 2018 -0700
@@ -119,6 +119,7 @@
             "-XX:+UseCompressedOops",
             collectorOption,
             "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"),
+            "-Xlog:cds,cds+hashtables",
             extraOption);
 
         if (expectedWarning != null)
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/InternSharedString.java	Thu Aug 09 15:52:23 2018 -0700
@@ -43,7 +43,7 @@
         SharedStringsUtils.buildJarAndWhiteBox("InternStringTest");
 
         SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("InternStringTest"),
-            "ExtraSharedInput.txt");
+            "ExtraSharedInput.txt", "-Xlog:cds,cds+hashtables");
 
         String[] extraMatches = new String[]   {
             InternStringTest.passed_output1,
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LargePages.java	Thu Aug 09 15:52:23 2018 -0700
@@ -36,15 +36,16 @@
  * @run main/othervm -XX:-CompactStrings LargePages
  */
 public class LargePages {
+    static final String CDS_LOGGING = "-Xlog:cds,cds+hashtables";
     public static void main(String[] args) throws Exception {
         SharedStringsUtils.buildJar("HelloString");
 
         SharedStringsUtils.dump(TestCommon.list("HelloString"),
-            "SharedStringsBasic.txt", "-XX:+UseLargePages");
+            "SharedStringsBasic.txt", "-XX:+UseLargePages", CDS_LOGGING);
         SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseLargePages");
 
         SharedStringsUtils.dump(TestCommon.list("HelloString"),
-            "SharedStringsBasic.txt",
+            "SharedStringsBasic.txt", CDS_LOGGING,
             "-XX:+UseLargePages", "-XX:+UseLargePagesInMetaspace");
         SharedStringsUtils.runWithArchive("HelloString",
             "-XX:+UseLargePages", "-XX:+UseLargePagesInMetaspace");
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/LockSharedStrings.java	Thu Aug 09 15:52:23 2018 -0700
@@ -44,7 +44,7 @@
 
         SharedStringsUtils.dumpWithWhiteBox(
             TestCommon.list("LockStringTest", "LockStringValueTest"),
-            "ExtraSharedInput.txt");
+            "ExtraSharedInput.txt", "-Xlog:cds,cds+hashtables");
 
         String[] extraMatch = new String[] {"LockStringTest: PASS"};
         SharedStringsUtils.runWithArchiveAndWhiteBox(extraMatch, "LockStringTest");
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsBasicPlus.java	Thu Aug 09 15:52:23 2018 -0700
@@ -42,7 +42,7 @@
         SharedStringsUtils.buildJarAndWhiteBox("HelloStringPlus");
 
         SharedStringsUtils.dumpWithWhiteBox( TestCommon.list("HelloStringPlus"),
-            "SharedStringsBasic.txt");
+            "SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables");
 
         SharedStringsUtils.runWithArchiveAndWhiteBox("HelloStringPlus");
     }
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java	Fri Aug 10 00:20:15 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsWbTest.java	Thu Aug 09 15:52:23 2018 -0700
@@ -45,7 +45,7 @@
         SharedStringsUtils.buildJarAndWhiteBox("SharedStringsWb");
 
         SharedStringsUtils.dumpWithWhiteBox(TestCommon.list("SharedStringsWb"),
-            "SharedStringsBasic.txt");
+            "SharedStringsBasic.txt", "-Xlog:cds,cds+hashtables");
 
         SharedStringsUtils.runWithArchiveAndWhiteBox("SharedStringsWb");
     }