Mon, 18 Aug 2014 15:41:57 +0200
8054362: gc/g1/TestEagerReclaimHumongousRegions2.java timeout
Summary: Give the test a time limit of approximately one minute so that it exits early on slow machines.
Reviewed-by: ehelin, dfazunen, brutisso
test/gc/g1/TestEagerReclaimHumongousRegions2.java | file | annotate | diff | comparison | revisions |
1.1 --- a/test/gc/g1/TestEagerReclaimHumongousRegions2.java Tue Aug 19 09:13:06 2014 +0000 1.2 +++ b/test/gc/g1/TestEagerReclaimHumongousRegions2.java Mon Aug 18 15:41:57 2014 +0200 1.3 @@ -46,6 +46,8 @@ 1.4 } 1.5 1.6 class ReclaimRegionFast { 1.7 + public static final long MAX_MILLIS_FOR_RUN = 50 * 1000; // The maximum runtime for the actual test. 1.8 + 1.9 public static final int M = 1024*1024; 1.10 1.11 public static LinkedList<Object> garbageList = new LinkedList<Object>(); 1.12 @@ -83,7 +85,14 @@ 1.13 1.14 Object ref_from_stack = large1; 1.15 1.16 + long start_millis = System.currentTimeMillis(); 1.17 + 1.18 for (int i = 0; i < 20; i++) { 1.19 + long current_millis = System.currentTimeMillis(); 1.20 + if ((current_millis - start_millis) > MAX_MILLIS_FOR_RUN) { 1.21 + System.out.println("Finishing test because maximum runtime exceeded"); 1.22 + break; 1.23 + } 1.24 // A set of large objects that will be reclaimed eagerly - and hopefully marked. 1.25 large1 = new int[M - 20]; 1.26 large2 = new int[M - 20];