Skip to content

Commit 6788e5f

Browse files
committedFeb 26, 2024
8305962: update jcstress to 0.16
Backport-of: 292ee630ae32c3b50363b10ffa6090e57ffef1e8
1 parent a59c2eb commit 6788e5f

File tree

5 files changed

+120
-5
lines changed

5 files changed

+120
-5
lines changed
 

‎test/hotspot/jtreg/applications/jcstress/JcstressRunner.java

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -42,11 +42,15 @@
4242
* jcstress tests wrapper
4343
*/
4444
@Artifact(organization = "org.openjdk.jcstress", name = "jcstress-tests-all",
45-
revision = "0.5", extension = "jar", unpack = false)
45+
revision = "0.16", extension = "jar", unpack = false)
4646
public class JcstressRunner {
4747

4848
public static final String MAIN_CLASS = "org.openjdk.jcstress.Main";
4949

50+
// Allow to configure jcstress mode parameter.
51+
// Test mode preset: sanity, quick, default, tough, stress.
52+
public static final String MODE_PROPERTY = "jcstress.mode";
53+
5054
public static Path pathToArtifact() {
5155
Map<String, Path> artifacts;
5256
try {
@@ -55,7 +59,7 @@ public static Path pathToArtifact() {
5559
throw new Error("TESTBUG: Can not resolve artifacts for "
5660
+ JcstressRunner.class.getName(), e);
5761
}
58-
return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.5")
62+
return artifacts.get("org.openjdk.jcstress.jcstress-tests-all-0.16")
5963
.toAbsolutePath();
6064
}
6165

@@ -104,11 +108,29 @@ private static String[] getCmd(String[] args) {
104108

105109
extraFlags.add("--jvmArgs");
106110
extraFlags.add("-Djava.io.tmpdir=" + System.getProperty("user.dir"));
111+
112+
// The "default" preset might take days for some tests
113+
// so use quick testing by default.
114+
String mode = "quick";
107115
for (String jvmArg : Utils.getTestJavaOpts()) {
116+
if(jvmArg.startsWith("-D" + MODE_PROPERTY)) {
117+
String[] pair = jvmArg.split("=", 2);
118+
mode = pair[1];
119+
continue;
120+
}
108121
extraFlags.add("--jvmArgs");
109122
extraFlags.add(jvmArg);
110123
}
111124

125+
extraFlags.add("-m");
126+
extraFlags.add(mode);
127+
128+
extraFlags.add("-sc");
129+
extraFlags.add("false");
130+
131+
extraFlags.add("-af");
132+
extraFlags.add("GLOBAL");
133+
112134
String[] result = new String[extraFlags.size() + args.length];
113135
extraFlags.toArray(result);
114136
System.arraycopy(args, 0, result, extraFlags.size(), args.length);

‎test/hotspot/jtreg/applications/jcstress/TestGenerator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* 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 {
122122
BufferedReader reader = Files.newBufferedReader(output);
123123

124124
reader.lines()
125-
.skip(4) // skip first 4 lines: name, -{80}, revision and empty line
125+
.filter(s -> s.startsWith("org.openjdk.jcstress.tests"))
126126
.map(s -> s.split("\\.")[4]) // group by the package name following "org.openjdk.jcstress.tests."
127127
.distinct()
128128
.filter(s -> !s.startsWith("sample")) // skip sample test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
25+
26+
/**
27+
* @test collections
28+
* @library /test/lib /
29+
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.collections\.
30+
*/
31+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
25+
26+
/**
27+
* @test mxbeans
28+
* @library /test/lib /
29+
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.mxbeans\.
30+
*/
31+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/* DO NOT MODIFY THIS FILE. GENERATED BY applications.jcstress.TestGenerator */
25+
26+
/**
27+
* @test oota
28+
* @library /test/lib /
29+
* @run driver/timeout=21600 applications.jcstress.JcstressRunner -v -t org.openjdk.jcstress.tests.oota\.
30+
*/
31+

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Feb 26, 2024

@openjdk-notifier[bot]
Please sign in to comment.