diff --git a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java index e5d3df3dc0..37ce9e7df7 100644 --- a/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java +++ b/test/hotspot/jtreg/applications/jcstress/JcstressRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -42,11 +42,15 @@ * jcstress tests wrapper */ @Artifact(organization = "org.openjdk.jcstress", name = "jcstress-tests-all", - revision = "0.5", extension = "jar", unpack = false) + revision = "0.16", extension = "jar", unpack = false) public class JcstressRunner { public static final String MAIN_CLASS = "org.openjdk.jcstress.Main"; + // Allow to configure jcstress mode parameter. + // Test mode preset: sanity, quick, default, tough, stress. + public static final String MODE_PROPERTY = "jcstress.mode"; + public static Path pathToArtifact() { Map artifacts; try { @@ -55,7 +59,7 @@ public static Path pathToArtifact() { throw new Error("TESTBUG: Can not resolve artifacts for " + JcstressRunner.class.getName(), e); } - return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.5") + return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.16") .toAbsolutePath(); } @@ -104,11 +108,29 @@ private static String[] getCmd(String[] args) { extraFlags.add("--jvmArgs"); extraFlags.add("-Djava.io.tmpdir=" + System.getProperty("user.dir")); + + // The "default" preset might take days for some tests + // so use quick testing by default. + String mode = "quick"; for (String jvmArg : Utils.getTestJavaOpts()) { + if(jvmArg.startsWith("-D" + MODE_PROPERTY)) { + String[] pair = jvmArg.split("=", 2); + mode = pair[1]; + continue; + } extraFlags.add("--jvmArgs"); extraFlags.add(jvmArg); } + extraFlags.add("-m"); + extraFlags.add(mode); + + extraFlags.add("-sc"); + extraFlags.add("false"); + + extraFlags.add("-af"); + extraFlags.add("GLOBAL"); + String[] result = new String[extraFlags.size() + args.length]; extraFlags.toArray(result); System.arraycopy(args, 0, result, extraFlags.size(), args.length); diff --git a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java index fc7a95f1e7..97cd6a98fd 100644 --- a/test/hotspot/jtreg/applications/jcstress/TestGenerator.java +++ b/test/hotspot/jtreg/applications/jcstress/TestGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -122,7 +122,7 @@ public static void main(String[] args) throws IOException { BufferedReader reader = Files.newBufferedReader(output); reader.lines() - .skip(4) // skip first 4 lines: name, -{80}, revision and empty line + .filter(s -> s.startsWith("org.openjdk.jcstress.tests")) .map(s -> s.split("\\.")[4]) // group by the package name following "org.openjdk.jcstress.tests." .distinct() .filter(s -> !s.startsWith("sample")) // skip sample test diff --git a/test/hotspot/jtreg/applications/jcstress/collections.java b/test/hotspot/jtreg/applications/jcstress/collections.java new file mode 100644 index 0000000000..176f004495 --- /dev/null +++ b/test/hotspot/jtreg/applications/jcstress/collections.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */ + +/** + * @test collections + * @library /test/lib / + * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.collections\. + */ + diff --git a/test/hotspot/jtreg/applications/jcstress/mxbeans.java b/test/hotspot/jtreg/applications/jcstress/mxbeans.java new file mode 100644 index 0000000000..64f5e760f9 --- /dev/null +++ b/test/hotspot/jtreg/applications/jcstress/mxbeans.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */ + +/** + * @test mxbeans + * @library /test/lib / + * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.mxbeans\. + */ + diff --git a/test/hotspot/jtreg/applications/jcstress/oota.java b/test/hotspot/jtreg/applications/jcstress/oota.java new file mode 100644 index 0000000000..c558006cc9 --- /dev/null +++ b/test/hotspot/jtreg/applications/jcstress/oota.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */ + +/** + * @test oota + * @library /test/lib / + * @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.oota\. + */ +