diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index 24fb487396d..a8794af0e3f 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -53,6 +53,7 @@ requires.extraPropDefns.vmOpts = \ requires.properties= \ sun.arch.data.model \ java.runtime.name \ + vm.flagless \ vm.gc.G1 \ vm.gc.Serial \ vm.gc.Parallel \ diff --git a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index a1fb82bcbb5..133ca19be74 100644 --- a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 8028994 * @author Staffan Larsen + * @requires vm.flagless * @library /test/lib * @modules jdk.attach/sun.tools.attach * jdk.management diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java index 8a78e644a65..31df96fd80e 100644 --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -689,15 +689,19 @@ public class VMProps implements Callable> { // check -X flags var ignoredXFlags = Set.of( // default, yet still seen to be explicitly set - "mixed" + "mixed", + // -XmxmNNNm added by run-test framework for non-hotspot tests + "mx" ); result &= allFlags.stream() .filter(s -> s.startsWith("-X") && !s.startsWith("-XX:")) // map to names: - // remove -X - .map(s -> s.substring(2)) - // remove :.* from flags with values - .map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s) + // remove -X + .map(s -> s.substring(2)) + // remove :.* from flags with values + .map(s -> s.contains(":") ? s.substring(0, s.indexOf(':')) : s) + // remove size like 4G, 768m which might be set for non-hotspot tests + .map(s -> s.replaceAll("(\\d+)[mMgGkK]", "")) // skip known-to-be-there flags .filter(s -> !ignoredXFlags.contains(s)) .findAny()