Skip to content

Commit a2d7c66

Browse files
authored
Merge pull request #21325 from tajila/jfrbackport
(0.51) Backport JFR test changes
2 parents 37b2cbf + 77b133e commit a2d7c66

File tree

2 files changed

+98
-1
lines changed

2 files changed

+98
-1
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2+
3+
<!--
4+
Copyright IBM Corp. and others 2025
5+
6+
This program and the accompanying materials are made available under
7+
the terms of the Eclipse Public License 2.0 which accompanies this
8+
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
9+
or the Apache License, Version 2.0 which accompanies this distribution and
10+
is available at https://www.apache.org/licenses/LICENSE-2.0.
11+
12+
This Source Code may also be made available under the following
13+
Secondary Licenses when the conditions for such availability set
14+
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
15+
General Public License, version 2 with the GNU Classpath
16+
Exception [1] and GNU General Public License, version 2 with the
17+
OpenJDK Assembly Exception [2].
18+
19+
[1] https://www.gnu.org/software/classpath/license.html
20+
[2] https://openjdk.org/legal/assembly-exception.html
21+
22+
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
23+
-->
24+
25+
<!DOCTYPE suite SYSTEM "cmdlinetester.dtd">
26+
27+
<suite id="JFR Tests" timeout="3000">
28+
<test id="runWorkload - approx 300 seconds">
29+
<command>$EXE$ -XX:StartFlightRecording -Dibm.java9.forceCommonCleanerShutdown=true -Xint -Xcheck:memory --add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED -cp $RESJAR$ org.openj9.test.WorkLoad 10 100 10</command>
30+
<output type="required" caseSensitive="yes" regex="no">All runs complete.</output>
31+
<output type="required" caseSensitive="yes" regex="no">Memory checker statistics:</output>
32+
<output type="failure" caseSensitive="yes" regex="no">unfreed blocks remaining at shutdown!</output>
33+
<output type="success" caseSensitive="yes" regex="no">All allocated blocks were freed.</output>
34+
</test>
35+
<test id="test jfr summary - approx 30seconds">
36+
<command>$JFR_EXE$ summary defaultJ9recording.jfr</command>
37+
<output type="required" caseSensitive="yes" regex="no">Version: 2.1</output>
38+
<output type="required" caseSensitive="yes" regex="no">jdk.ExecutionSample</output>
39+
<output type="success" caseSensitive="yes" regex="no">jdk.CPULoad</output>
40+
<output type="success" caseSensitive="yes" regex="no">jdk.JavaThreadStatistics</output>
41+
<output type="success" caseSensitive="yes" regex="no">jdk.ClassLoadingStatistics</output>
42+
<output type="success" caseSensitive="yes" regex="no">jdk.ThreadCPULoad</output>
43+
<output type="required" caseSensitive="yes" regex="no">jdk.Metadata</output>
44+
</test>
45+
<test id="test jfr execution sample - approx 30seconds">
46+
<command>$JFR_EXE$ print --xml --events "ExecutionSample" --stack-depth 1 defaultJ9recording.jfr</command>
47+
<output type="required" caseSensitive="yes" regex="no">http://www.w3.org/2001/XMLSchema-instance</output>
48+
<output type="required" caseSensitive="yes" regex="no">jdk.ExecutionSample</output>
49+
<output type="required" caseSensitive="yes" regex="no">startTime</output>
50+
<output type="required" caseSensitive="yes" regex="no">sampledThread</output>
51+
<output type="required" caseSensitive="yes" regex="no">stackTrace</output>
52+
<output type="required" caseSensitive="yes" regex="no">frames</output>
53+
<output type="success" caseSensitive="yes" regex="no">STATE_RUNNABLE</output>
54+
<output type="failure" caseSensitive="yes" regex="no">jfr print: could not read recording</output>
55+
</test>
56+
<test id="test jfr thread start - approx 30seconds">
57+
<command>$JFR_EXE$ print --xml --events "ThreadStart" --stack-depth 1 defaultJ9recording.jfr</command>
58+
<output type="required" caseSensitive="yes" regex="no">http://www.w3.org/2001/XMLSchema-instance</output>
59+
<output type="required" caseSensitive="yes" regex="no">jdk.ThreadStart</output>
60+
<output type="required" caseSensitive="yes" regex="no">eventThread</output>
61+
<output type="required" caseSensitive="yes" regex="no">osName</output>
62+
<output type="required" caseSensitive="yes" regex="no">osThreadId</output>
63+
<output type="required" caseSensitive="yes" regex="no">javaName</output>
64+
<output type="success" caseSensitive="yes" regex="no">stackTrace</output>
65+
<output type="failure" caseSensitive="yes" regex="no">jfr print: could not read recording</output>
66+
</test>
67+
</suite>

test/functional/cmdLineTests/jfr/playlist.xml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,39 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
4646
<impl>openj9</impl>
4747
<impl>ibm</impl>
4848
</impls>
49-
<!-- For the time being, JFR tests are only limited to JDK17+. -->
49+
<!-- For the time being, JFR tests are only limited to JDK11+. -->
5050
<versions>
5151
<version>11+</version>
5252
</versions>
5353
</test>
54+
<test>
55+
<testCaseName>cmdLineTester_jfrEvents</testCaseName>
56+
<variations>
57+
<variation>NoOptions</variation>
58+
</variations>
59+
<command>
60+
$(JAVA_COMMAND) $(CMDLINETESTER_JVM_OPTIONS) -Xdump \
61+
-DEXE=$(SQ)$(JAVA_COMMAND) $(JVM_OPTIONS)$(SQ) \
62+
-DJFR_EXE=$(Q)$(TEST_JDK_HOME)$(D)bin$(D)jfr$(Q) \
63+
-DMETADATA_BLOB_PATH=$(Q)$(TEST_RESROOT)$(D)metadata.blob$(Q) \
64+
-DRESJAR=$(Q)$(TEST_RESROOT)$(D)jfr.jar$(Q) \
65+
-jar $(CMDLINETESTER_JAR) -config $(Q)$(TEST_RESROOT)$(D)jfrevents.xml$(Q) \
66+
-explainExcludes -xids all,$(PLATFORM),$(VARIATION) -nonZeroExitWhenError; \
67+
${TEST_STATUS}
68+
</command>
69+
<levels>
70+
<level>sanity</level>
71+
</levels>
72+
<groups>
73+
<group>functional</group>
74+
</groups>
75+
<impls>
76+
<impl>openj9</impl>
77+
<impl>ibm</impl>
78+
</impls>
79+
<!-- For the time being, these tests are limited to JDK17+. -->
80+
<versions>
81+
<version>17+</version>
82+
</versions>
83+
</test>
5484
</playlist>

0 commit comments

Comments
 (0)