8244384: @requires-related clean up in gc/metaspace/ tests

Reviewed-by: kbarrett, stefank
This commit is contained in:
Igor Ignatyev 2020-05-05 09:27:24 -07:00
parent c976be69c3
commit a899004d4e
2 changed files with 9 additions and 17 deletions

@ -36,7 +36,6 @@ package gc.metaspace;
*/
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.SA.SATestUtils;
@ -50,11 +49,6 @@ public class CompressedClassSpaceSizeInJmapHeap {
public static void main(String[] args) throws Exception {
SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
if (!Platform.is64bit()) {
// Compressed Class Space is only available on 64-bit JVMs
return;
}
String pid = Long.toString(ProcessTools.getProcessId());
JDKToolLauncher jmap = JDKToolLauncher.create("jhsdb")

@ -30,6 +30,7 @@ package gc.metaspace;
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
* @requires vm.bits == 32
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.metaspace.TestCapacityUntilGCWrapAround
@ -38,7 +39,6 @@ package gc.metaspace;
import sun.hotspot.WhiteBox;
import jdk.test.lib.Asserts;
import jdk.test.lib.Platform;
public class TestCapacityUntilGCWrapAround {
private static long MB = 1024 * 1024;
@ -46,17 +46,15 @@ public class TestCapacityUntilGCWrapAround {
private static long MAX_UINT = 4 * GB - 1; // On 32-bit platforms
public static void main(String[] args) {
if (Platform.is32bit()) {
WhiteBox wb = WhiteBox.getWhiteBox();
WhiteBox wb = WhiteBox.getWhiteBox();
long before = wb.metaspaceCapacityUntilGC();
// Now force possible overflow of capacity_until_GC.
long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);
long before = wb.metaspaceCapacityUntilGC();
// Now force possible overflow of capacity_until_GC.
long after = wb.incMetaspaceCapacityUntilGC(MAX_UINT);
Asserts.assertGTE(after, before,
"Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
Asserts.assertLTE(after, MAX_UINT,
"Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
}
Asserts.assertGTE(after, before,
"Increasing with MAX_UINT should not cause wrap around: " + after + " < " + before);
Asserts.assertLTE(after, MAX_UINT,
"Increasing with MAX_UINT should not cause value larger than MAX_UINT:" + after);
}
}