< prev index next >

test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java

Print this page
rev 55094 : [mq]: split_test
rev 55095 : [mq]: use_flag_rotation

*** 31,56 **** import java.util.regex.Matcher; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; - import jtreg.SkippedException; - import sun.hotspot.gc.GC; import sun.hotspot.WhiteBox; /* * @test TestMetaSpaceLog * @bug 8211123 * @summary Ensure that the Metaspace is updated in the log * @key gc * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * * @compile TestMetaSpaceLog.java * @run driver ClassFileInstaller sun.hotspot.WhiteBox ! * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.logging.TestMetaSpaceLog */ public class TestMetaSpaceLog { private static Pattern metaSpaceRegexp; --- 31,55 ---- import java.util.regex.Matcher; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import sun.hotspot.WhiteBox; /* * @test TestMetaSpaceLog * @bug 8211123 * @summary Ensure that the Metaspace is updated in the log * @key gc * @library /test/lib * @modules java.base/jdk.internal.misc * java.management + * @requires vm.gc != "Epsilon" * * @compile TestMetaSpaceLog.java * @run driver ClassFileInstaller sun.hotspot.WhiteBox ! * @run driver gc.logging.TestMetaSpaceLog */ public class TestMetaSpaceLog { private static Pattern metaSpaceRegexp;
*** 58,88 **** // Do this once here. metaSpaceRegexp = Pattern.compile(".*Metaspace: ([0-9]+).*->([0-9]+).*"); } public static void main(String[] args) throws Exception { ! boolean noneGCSupported = true; ! ! if (GC.Parallel.isSupported()) { ! noneGCSupported = false; ! testMetaSpaceUpdate("UseParallelGC"); ! } ! if (GC.G1.isSupported()) { ! noneGCSupported = false; ! testMetaSpaceUpdate("UseG1GC"); ! } ! if (GC.ConcMarkSweep.isSupported()) { ! noneGCSupported = false; ! testMetaSpaceUpdate("UseConcMarkSweepGC"); ! } ! if (GC.Serial.isSupported()) { ! noneGCSupported = false; ! testMetaSpaceUpdate("UseSerialGC"); ! } ! if (noneGCSupported) { ! throw new SkippedException("Skipping test because none of Parallel/G1/ConcMarkSweep/Serial is supported."); ! } } private static void verifyContainsMetaSpaceUpdate(OutputAnalyzer output) { // At least one metaspace line from GC should show GC being collected. boolean foundCollectedMetaSpace = output.asLines().stream() --- 57,67 ---- // Do this once here. metaSpaceRegexp = Pattern.compile(".*Metaspace: ([0-9]+).*->([0-9]+).*"); } public static void main(String[] args) throws Exception { ! testMetaSpaceUpdate(); } private static void verifyContainsMetaSpaceUpdate(OutputAnalyzer output) { // At least one metaspace line from GC should show GC being collected. boolean foundCollectedMetaSpace = output.asLines().stream()
*** 97,114 **** long before = Long.parseLong(m.group(1)); long after = Long.parseLong(m.group(2)); return before > after; } ! private static void testMetaSpaceUpdate(String gcFlag) throws Exception { // Propagate test.src for the jar file. String testSrc= "-Dtest.src=" + System.getProperty("test.src", "."); - System.err.println("Testing with GC Flag: " + gcFlag); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ! "-XX:+" + gcFlag, "-Xlog:gc*", "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xmx1000M", --- 76,92 ---- long before = Long.parseLong(m.group(1)); long after = Long.parseLong(m.group(2)); return before > after; } ! private static void testMetaSpaceUpdate() throws Exception { // Propagate test.src for the jar file. String testSrc= "-Dtest.src=" + System.getProperty("test.src", "."); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ! true, "-Xlog:gc*", "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xmx1000M",
< prev index next >