Tue, 25 Nov 2014 18:16:18 +0400
8065749: [TESTBUG]: gc/arguments/TestG1HeapRegionSize.java fails at nightly
Reviewed-by: brutisso
test/gc/arguments/TestG1HeapRegionSize.java | file | annotate | diff | comparison | revisions |
1.1 --- a/test/gc/arguments/TestG1HeapRegionSize.java Mon Oct 29 05:48:53 2018 -0700 1.2 +++ b/test/gc/arguments/TestG1HeapRegionSize.java Tue Nov 25 18:16:18 2014 +0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 -* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 1.6 +* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -25,12 +25,11 @@ 1.11 * @test TestG1HeapRegionSize 1.12 * @key gc 1.13 * @bug 8021879 1.14 - * @requires vm.gc=="G1" | vm.gc=="null" 1.15 * @summary Verify that the flag G1HeapRegionSize is updated properly 1.16 * @run main/othervm -Xmx64m TestG1HeapRegionSize 1048576 1.17 - * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m -XX:+UseG1GC TestG1HeapRegionSize 2097152 1.18 - * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m -XX:+UseG1GC TestG1HeapRegionSize 2097152 1.19 - * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m -XX:+UseG1GC TestG1HeapRegionSize 33554432 1.20 + * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m TestG1HeapRegionSize 2097152 1.21 + * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m TestG1HeapRegionSize 2097152 1.22 + * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m TestG1HeapRegionSize 33554432 1.23 */ 1.24 1.25 import sun.management.ManagementFactoryHelper; 1.26 @@ -43,7 +42,13 @@ 1.27 HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); 1.28 1.29 String expectedValue = getExpectedValue(args); 1.30 - VMOption option = diagnostic.getVMOption("G1HeapRegionSize"); 1.31 + VMOption option = diagnostic.getVMOption("UseG1GC"); 1.32 + if (option.getValue().equals("false")) { 1.33 + System.out.println("Skipping this test. It is only a G1 test."); 1.34 + return; 1.35 + } 1.36 + 1.37 + option = diagnostic.getVMOption("G1HeapRegionSize"); 1.38 if (!expectedValue.equals(option.getValue())) { 1.39 throw new RuntimeException("Wrong value for G1HeapRegionSize. Expected " + expectedValue + " but got " + option.getValue()); 1.40 }