Skip to content

Commit 5329560

Browse files
committed
cvm/overlay: (2/2) Fix gc/startup_warnings tests
Adjust the startup warning tests to match the JDK17 hotspot behavior while keeping the changes isolated under the JDK 8 overlay. - TestCMSForegroundFlags.java: JDK 17 no longer emits the JDK 8 deprecation warnings for UseCMSCompactAtFullCollection, CMSFullGCsBeforeCompaction, and UseCMSCollectionPassing; assert no warning is emitted. - TestCMSIncrementalMode.java: JDK 17 accepts the legacy incremental CMS option combination without the JDK 8 warning; align the test with that no-warning behavior. - TestDefNewCMS.java: JDK 17 no longer reports the old DefNew+CMS deprecation warning on this compatibility path; assert clean execution without warning or error. - TestDefaultMaxRAMFraction.java: JDK 17 still warns for DefaultMaxRAMFraction, but the warning is emitted by the JDK 17 flag deprecation path with different wording; update the expected text to the JDK17 hotspot message. - TestIncGC.java: JDK 17 accepts the -Xincgc compatibility option without the old incremental CMS warning; assert the JDK 17 no-warning behavior. - TestParNewSerialOld.java: JDK 17 no longer emits the old ParNew+SerialOld deprecation warning; assert clean execution without warning or error.
1 parent c84f3d7 commit 5329560

9 files changed

Lines changed: 12 additions & 18 deletions

cvm.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,12 @@ endif
448448
$(call overlay_single,jdk8u,hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java, $(JDK8_SRCROOT))
449449
$(call overlay_single,jdk8u,hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java, $(JDK8_SRCROOT))
450450
$(call overlay_single,jdk8u,hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java, $(JDK8_SRCROOT))
451+
$(call overlay_single,jdk8u,hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java, $(JDK8_SRCROOT))
452+
$(call overlay_single,jdk8u,hotspot/test/gc/startup_warnings/TestCMSIncrementalMode.java, $(JDK8_SRCROOT))
453+
$(call overlay_single,jdk8u,hotspot/test/gc/startup_warnings/TestDefNewCMS.java, $(JDK8_SRCROOT))
454+
$(call overlay_single,jdk8u,hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java, $(JDK8_SRCROOT))
455+
$(call overlay_single,jdk8u,hotspot/test/gc/startup_warnings/TestIncGC.java, $(JDK8_SRCROOT))
456+
$(call overlay_single,jdk8u,hotspot/test/gc/startup_warnings/TestParNewSerialOld.java, $(JDK8_SRCROOT))
451457

452458
-overlay-jtreg:
453459
$(call overlay_single,jdk8u,test/jtreg-ext/requires/VMProps.java, $(JDK8_SRCROOT))

cvm/conf/jtreg_hotspot8_excludes_aarch64.list

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@ gc/g1/TestStringSymbolTableStats.java
4343
gc/logging/TestGCId.java
4444
gc/metaspace/TestMetaspaceSizeFlags.java
4545
gc/parallelScavenge/AdaptiveGCBoundary.java
46-
gc/startup_warnings/TestCMSForegroundFlags.java
47-
gc/startup_warnings/TestCMSIncrementalMode.java
48-
gc/startup_warnings/TestDefaultMaxRAMFraction.java
49-
gc/startup_warnings/TestDefNewCMS.java
50-
gc/startup_warnings/TestIncGC.java
5146
gc/6581734/Test6581734.java
52-
gc/startup_warnings/TestParNewSerialOld.java
5347
gc/survivorAlignment/TestAllocationInEden.java
5448
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
5549
gc/survivorAlignment/TestPromotionFromEdenToTenured.java

cvm/conf/jtreg_hotspot8_excludes_x64.list

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ gc/g1/TestStringSymbolTableStats.java
3737
gc/logging/TestGCId.java
3838
gc/metaspace/TestMetaspaceSizeFlags.java
3939
gc/parallelScavenge/AdaptiveGCBoundary.java
40-
gc/startup_warnings/TestCMSForegroundFlags.java
41-
gc/startup_warnings/TestCMSIncrementalMode.java
42-
gc/startup_warnings/TestDefaultMaxRAMFraction.java
43-
gc/startup_warnings/TestDefNewCMS.java
44-
gc/startup_warnings/TestIncGC.java
4540
gc/6581734/Test6581734.java
46-
gc/startup_warnings/TestParNewSerialOld.java
4741
gc/survivorAlignment/TestAllocationInEden.java
4842
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
4943
gc/survivorAlignment/TestPromotionFromEdenToTenured.java

cvm/overlay/jdk8u/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static void main(String[] args) throws Exception {
4545

4646
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flagValue, "-version");
4747
OutputAnalyzer output = new OutputAnalyzer(pb.start());
48-
output.shouldContain("warning: " + flagName + " is deprecated and will likely be removed in a future release.");
48+
output.shouldNotContain("warning");
4949
output.shouldNotContain("error");
5050
output.shouldHaveExitValue(0);
5151
}

cvm/overlay/jdk8u/hotspot/test/gc/startup_warnings/TestCMSIncrementalMode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class TestCMSIncrementalMode {
3838
public static void main(String args[]) throws Exception {
3939
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseConcMarkSweepGC", "-XX:+CMSIncrementalMode", "-version");
4040
OutputAnalyzer output = new OutputAnalyzer(pb.start());
41-
output.shouldContain("warning: Using incremental CMS is deprecated and will likely be removed in a future release");
41+
output.shouldNotContain("warning");
4242
output.shouldNotContain("error");
4343
output.shouldHaveExitValue(0);
4444
}

cvm/overlay/jdk8u/hotspot/test/gc/startup_warnings/TestDefNewCMS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class TestDefNewCMS {
3737
public static void main(String args[]) throws Exception {
3838
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version");
3939
OutputAnalyzer output = new OutputAnalyzer(pb.start());
40-
output.shouldContain("warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release");
40+
output.shouldNotContain("warning");
4141
output.shouldNotContain("error");
4242
output.shouldHaveExitValue(0);
4343
}

cvm/overlay/jdk8u/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class TestDefaultMaxRAMFraction {
3636
public static void main(String[] args) throws Exception {
3737
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:DefaultMaxRAMFraction=4", "-version");
3838
OutputAnalyzer output = new OutputAnalyzer(pb.start());
39-
output.shouldContain("warning: DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. Use MaxRAMFraction instead.");
39+
output.shouldContain("warning: Option DefaultMaxRAMFraction was deprecated in version 8.0 and will likely be removed in a future release. Use option MaxRAMFraction instead.");
4040
output.shouldNotContain("error");
4141
output.shouldHaveExitValue(0);
4242
}

cvm/overlay/jdk8u/hotspot/test/gc/startup_warnings/TestIncGC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class TestIncGC {
3838
public static void main(String args[]) throws Exception {
3939
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xincgc", "-version");
4040
OutputAnalyzer output = new OutputAnalyzer(pb.start());
41-
output.shouldContain("warning: Using incremental CMS is deprecated and will likely be removed in a future release");
41+
output.shouldNotContain("warning");
4242
output.shouldNotContain("error");
4343
output.shouldHaveExitValue(0);
4444
}

cvm/overlay/jdk8u/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class TestParNewSerialOld {
3838
public static void main(String args[]) throws Exception {
3939
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-version");
4040
OutputAnalyzer output = new OutputAnalyzer(pb.start());
41-
output.shouldContain("warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release");
41+
output.shouldNotContain("warning");
4242
output.shouldNotContain("error");
4343
output.shouldHaveExitValue(0);
4444
}

0 commit comments

Comments
 (0)