Skip to content

Commit 66c653c

Browse files
committedAug 4, 2021
8271721: Split gc/g1/TestMixedGCLiveThreshold into separate tests
Reviewed-by: tschatzl, rrich
1 parent 68dd828 commit 66c653c

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed
 

‎test/hotspot/jtreg/gc/g1/TestMixedGCLiveThreshold.java

+30-12
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,36 @@
2424
package gc.g1;
2525

2626
/*
27-
* @test TestMixedGCLiveThreshold
28-
* @summary Test G1MixedGCLiveThresholdPercent. Fill up a region to at least 1/3 region-size,
29-
* the region should not be selected for mixed GC cycle if liveness is above threshold.
27+
* @test id=0percent
28+
* @summary Test G1MixedGCLiveThresholdPercent=0. Fill up a region to at least 33 percent,
29+
* the region should not be selected for mixed GC cycle.
3030
* @requires vm.gc.G1
3131
* @library /test/lib
3232
* @build sun.hotspot.WhiteBox
3333
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
34-
* @run driver gc.g1.TestMixedGCLiveThreshold
34+
* @run driver gc.g1.TestMixedGCLiveThreshold 0 false
35+
*/
36+
37+
/*
38+
* @test id=25percent
39+
* @summary Test G1MixedGCLiveThresholdPercent=25. Fill up a region to at least 33 percent,
40+
* the region should not be selected for mixed GC cycle.
41+
* @requires vm.gc.G1
42+
* @library /test/lib
43+
* @build sun.hotspot.WhiteBox
44+
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
45+
* @run driver gc.g1.TestMixedGCLiveThreshold 25 false
46+
*/
47+
48+
/*
49+
* @test id=100percent
50+
* @summary Test G1MixedGCLiveThresholdPercent=100. Fill up a region to at least 33 percent,
51+
* the region should be selected for mixed GC cycle.
52+
* @requires vm.gc.G1
53+
* @library /test/lib
54+
* @build sun.hotspot.WhiteBox
55+
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
56+
* @run driver gc.g1.TestMixedGCLiveThreshold 100 true
3557
*/
3658

3759
import java.util.ArrayList;
@@ -48,14 +70,9 @@ public class TestMixedGCLiveThreshold {
4870
private static final String pattern = "Remembered Set Tracking update regions total ([0-9]+), selected ([0-9]+)$";
4971

5072
public static void main(String[] args) throws Exception {
51-
// -XX:G1MixedGCLiveThresholdPercent=0
52-
testMixedGCLiveThresholdPercent(0, false);
53-
54-
// -XX:G1MixedGCLiveThresholdPercent=25
55-
testMixedGCLiveThresholdPercent(25, false);
56-
57-
// -XX:G1MixedGCLiveThresholdPercent=100
58-
testMixedGCLiveThresholdPercent(100, true);
73+
int liveThresholdPercent = Integer.parseInt(args[0]);
74+
boolean expectRebuild = Boolean.parseBoolean(args[1]);
75+
testMixedGCLiveThresholdPercent(liveThresholdPercent, expectRebuild);
5976
}
6077

6178
private static void testMixedGCLiveThresholdPercent(int liveThresholdPercent, boolean expectedRebuild) throws Exception {
@@ -71,6 +88,7 @@ private static void testMixedGCLiveThresholdPercent(int liveThresholdPercent, bo
7188
" no regions should be selected")
7289
);
7390
output.shouldHaveExitValue(0);
91+
output.reportDiagnosticSummary();
7492
}
7593

7694
private static OutputAnalyzer testWithMixedGCLiveThresholdPercent(int percent) throws Exception {

0 commit comments

Comments
 (0)