8069343: Improve gc/g1/TestHumongousCodeCacheRoots.java to use jtreg @requires
authorjcbeyler
Wed, 01 Aug 2018 09:23:24 -0700
changeset 51282 1c8cdf3d4c9e
parent 51281 3bd8d0a0e28c
child 51283 ac4f5ef0edd9
8069343: Improve gc/g1/TestHumongousCodeCacheRoots.java to use jtreg @requires Summary: Remove client test entirely and clean up test Reviewed-by: tschatzl, iignatyev
test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java
--- a/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java	Tue Jul 31 10:20:10 2018 -0700
+++ b/test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java	Wed Aug 01 09:23:24 2018 -0700
@@ -119,26 +119,10 @@
 
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs.toArray(new String[0]));
     OutputAnalyzer output = new OutputAnalyzer(pb.start());
-    try {
-        output.shouldHaveExitValue(0);
-    } catch (RuntimeException e) {
-        // It's ok if there is no client vm in the jdk.
-        if (output.firstMatch("Unrecognized option: -client") == null) {
-            throw e;
-        }
-    }
-
+    output.shouldHaveExitValue(0);
     return output;
   }
 
-  public static void runTest(String compiler, String[] other) throws Exception {
-    ArrayList<String> joined = new ArrayList<String>();
-    joined.add(compiler);
-    joined.addAll(Arrays.asList(other));
-    runWhiteBoxTest(joined.toArray(new String[0]), TestHumongousCodeCacheRootsHelper.class.getName(),
-      new String[] {}, false);
-  }
-
   public static void main(String[] args) throws Exception {
     final String[] baseArguments = new String[] {
       "-XX:+UseG1GC", "-XX:G1HeapRegionSize=1M", "-Xmx100M", // make sure we get a humongous region
@@ -146,8 +130,9 @@
       "-XX:InitiatingHeapOccupancyPercent=1", // strong code root marking
       "-XX:+G1VerifyHeapRegionCodeRoots", "-XX:+VerifyAfterGC", // make sure that verification is run
     };
-    runTest("-client", baseArguments);
-    runTest("-server", baseArguments);
+
+    runWhiteBoxTest(baseArguments, TestHumongousCodeCacheRootsHelper.class.getName(),
+      new String[] {}, false);
   }
 }