--- old/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java 2017-11-07 10:10:44.071317913 +0100 +++ new/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGC.java 2017-11-07 10:10:43.658305226 +0100 @@ -90,7 +90,6 @@ private long delayMS; SystemGCTask(long delayMS) { -System.err.println("SystemGCTask with delay " + delayMS); this.delayMS = delayMS; } @@ -98,7 +97,7 @@ public void run() { while (!shouldExit()) { System.gc(); - ThreadUtils.sleep(delayMS * 10); + ThreadUtils.sleep(delayMS); } } } @@ -165,8 +164,7 @@ } private static void runAllPhases() { - int i = 0; - while (i < 4 && System.currentTimeMillis() < endTime) { + for (int i = 0; i < 4 && System.currentTimeMillis() < endTime; i++) { SystemGCTask gcTask = (i % 2 == 1) ? createSystemGCTask(numGroups / 3) : null; ShortLivedAllocationTask shortTask = @@ -185,16 +183,16 @@ exitTask(longTask); ThreadUtils.sleep(1000); - i++; } } - public static void main(String[] args) { - if (args.length > 0) { - int timeout = Integer.parseInt(args[0]) * 1000; - System.out.println("Running with timeout of " + timeout + "ms"); - endTime = System.currentTimeMillis() + timeout; - } + public static void main(String[] args) throws Exception { + if (args.length == 0) { + throw new IllegalArgumentException("Must specify timeout in seconds as first argument"); + } + int timeout = Integer.parseInt(args[0]) * 1000; + System.out.println("Running with timeout of " + timeout + "ms"); + endTime = System.currentTimeMillis() + timeout; // First allocate the long lived objects and then run all phases. populateLongLived(); runAllPhases(); --- old/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java 2017-11-07 10:10:45.496361686 +0100 +++ new/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java 2017-11-07 10:10:45.088349153 +0100 @@ -32,7 +32,7 @@ * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UseConcMarkSweepGC TestSystemGCWithCMS 270 */ public class TestSystemGCWithCMS { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { TestSystemGC.main(args); } } --- old/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithG1.java 2017-11-07 10:10:46.914405245 +0100 +++ new/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithG1.java 2017-11-07 10:10:46.506392712 +0100 @@ -32,7 +32,7 @@ * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UseG1GC TestSystemGCWithG1 270 */ public class TestSystemGCWithG1 { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { TestSystemGC.main(args); } } --- old/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithParallel.java 2017-11-07 10:10:48.347449264 +0100 +++ new/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithParallel.java 2017-11-07 10:10:47.932436516 +0100 @@ -32,7 +32,7 @@ * @run main/othervm/timeout=300 -Xlog:gc=info -Xmx512m -XX:+UseParallelGC TestSystemGCWithParallel 270 */ public class TestSystemGCWithParallel { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { TestSystemGC.main(args); } } --- old/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithSerial.java 2017-11-07 10:10:49.784493406 +0100 +++ new/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithSerial.java 2017-11-07 10:10:49.371480719 +0100 @@ -32,7 +32,7 @@ * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UseSerialGC TestSystemGCWithSerial 270 */ public class TestSystemGCWithSerial { - public static void main(String[] args) { + public static void main(String[] args) throws Exception { TestSystemGC.main(args); } }