diff --git a/doc/starting-next-release.html b/doc/starting-next-release.html
index 421229f9fbc..6cffdf38b0f 100644
--- a/doc/starting-next-release.html
+++ b/doc/starting-next-release.html
@@ -11,11 +11,8 @@
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
- /* The extra [class] is a hack that increases specificity enough to
- override a similar rule in reveal.js */
- ul.task-list[class]{list-style: none;}
+ ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
- font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
diff --git a/doc/testing.html b/doc/testing.html
index f75e0da309e..fa774aa312f 100644
--- a/doc/testing.html
+++ b/doc/testing.html
@@ -458,6 +458,12 @@ class, named Virtual, is currently part of the JDK build in the
test/jtreg_test_thread_factory/ directory. This class gets
compiled during the test image build. The implementation of the Virtual
class creates a new virtual thread for executing each test class.
+JVMTI_STRESS_AGENT
+Executes JTReg tests with JVM TI stress agent. The stress agent is
+the part of test library and located in
+test/lib/jdk/test/lib/jvmti/libJvmtiStressAgent.cpp. The
+value of this argument is set as JVM TI agent options. This mode uses
+ProblemList-jvmti-stress-agent.txt as an additional exclude list.
TEST_MODE
The test mode (agentvm or othervm).
Defaults to agentvm.
diff --git a/doc/testing.md b/doc/testing.md
index 525b85a8438..4cfc36c85f9 100644
--- a/doc/testing.md
+++ b/doc/testing.md
@@ -401,6 +401,13 @@ the `test/jtreg_test_thread_factory/` directory. This class gets compiled
during the test image build. The implementation of the Virtual class creates a
new virtual thread for executing each test class.
+#### JVMTI_STRESS_AGENT
+
+Executes JTReg tests with JVM TI stress agent. The stress agent is the part of
+test library and located in `test/lib/jdk/test/lib/jvmti/libJvmtiStressAgent.cpp`.
+The value of this argument is set as JVM TI agent options.
+This mode uses ProblemList-jvmti-stress-agent.txt as an additional exclude list.
+
#### TEST_MODE
The test mode (`agentvm` or `othervm`).
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index 574fd869092..46f9a2e4047 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -204,8 +204,9 @@ $(eval $(call SetTestOpt,AOT_JDK,JTREG))
$(eval $(call ParseKeywordVariable, JTREG, \
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
- TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS \
- RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT AOT_JDK $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
+ TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY JVMTI_STRESS_AGENT \
+ MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT \
+ AOT_JDK $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
$(CUSTOM_JTREG_STRING_KEYWORDS), \
@@ -876,6 +877,15 @@ define SetupRunJtregTestBody
))
endif
+ ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
+ AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
+ $1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:$(TEST_IMAGE_DIR)/hotspot/jtreg/native/$$(AGENT)'
+ $1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
+ $$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
+ ))
+ endif
+
+
ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
$1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
endif
diff --git a/make/RunTestsPrebuiltSpec.gmk b/make/RunTestsPrebuiltSpec.gmk
index 03c877a4277..e9fd901c9e1 100644
--- a/make/RunTestsPrebuiltSpec.gmk
+++ b/make/RunTestsPrebuiltSpec.gmk
@@ -176,3 +176,19 @@ ULIMIT := ulimit
ifeq ($(OPENJDK_BUILD_OS), windows)
PATHTOOL := cygpath
endif
+
+# These settings are needed to run testing with jvmti agent
+ifeq ($(OPENJDK_BUILD_OS), linux)
+ LIBRARY_PREFIX := lib
+ SHARED_LIBRARY_SUFFIX := .so
+endif
+
+ifeq ($(OPENJDK_BUILD_OS), windows)
+ LIBRARY_PREFIX :=
+ SHARED_LIBRARY_SUFFIX := .dll
+endif
+
+ifeq ($(OPENJDK_BUILD_OS), macosx)
+ LIBRARY_PREFIX := lib
+ SHARED_LIBRARY_SUFFIX := .dylib
+endif
diff --git a/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt b/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt
new file mode 100644
index 00000000000..636d02cb8b0
--- /dev/null
+++ b/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt
@@ -0,0 +1,101 @@
+#
+# Copyright (c) 2025, 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.
+#
+
+#############################################################################
+#
+# List of quarantined tests failing with jvmti stress agent in any mode.
+#
+#############################################################################
+
+
+compiler/macronodes/TestTopInMacroElimination.java 8362832 generic-all
+
+gc/stringdedup/TestStringDeduplicationAgeThreshold.java 8362562 generic-all
+gc/stringdedup/TestStringDeduplicationInterned.java 8362562 generic-all
+gc/stringdedup/TestStringDeduplicationPrintOptions.java 8362562 generic-all
+
+
+serviceability/jvmti/events/SingleStep/singlestep02/singlestep02.java 8362350 generic-all
+vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t007/TestDescription.java 8362350 generic-all
+
+# Incompatbile tests
+
+# IR
+compiler/loopopts/superword/TestDependencyOffsets.java#avx1-v016-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx1-v016-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx1-v032-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx1-v032-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx2-v016-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx2-v016-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx2-v032-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#avx2-v032-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#sse4-v004-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#sse4-v004-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#sse4-v008-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#sse4-v008-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#sse4-v016-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#sse4-v016-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vanilla-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vanilla-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v004-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v004-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v008-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v008-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v016-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v016-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v032-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v032-U 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v064-A 0000000 generic-all
+compiler/loopopts/superword/TestDependencyOffsets.java#vec-v064-U 0000000 generic-all
+
+# Requires solo jvmti capabilities
+
+compiler/jvmci/events/JvmciShutdownEventTest.java 0000000 generic-all
+
+# jdwp
+runtime/6294277/SourceDebugExtension.java 0000000 generic-all
+
+# heap stats
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorArrayAllSampledTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorEventOnOffTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCParallelTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCSerialTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorIllegalArgumentTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorInitialAllocationTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorInterpreterArrayTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorInterpreterObjectTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorMultiArrayTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorNoCapabilityTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorRecursiveTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatSimpleTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadDisabledTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadOnOffTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorTwoAgentsTest.java 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java#id0 0000000 generic-all
+serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java#id1 0000000 generic-all
diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java b/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
index 6782bd68fed..8e509c66c9a 100644
--- a/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
+++ b/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java
@@ -36,6 +36,7 @@ import jdk.test.lib.Platform;
import jdk.test.lib.Utils;
import jdk.test.lib.helpers.ClassFileInstaller;
import jdk.test.whitebox.WhiteBox;
+import jtreg.SkippedException;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -349,6 +350,7 @@ public class TestFramework {
if (shouldInstallWhiteBox()) {
installWhiteBox();
}
+ checkCompatibleFlags();
checkIRRuleCompilePhasesFormat();
disableIRVerificationIfNotFeasible();
@@ -775,12 +777,23 @@ public class TestFramework {
return Arrays.stream(testClass.getDeclaredMethods()).anyMatch(m -> m.getAnnotationsByType(IR.class).length > 0);
}
+ private void checkCompatibleFlags() {
+ for (String flag : Utils.getTestJavaOpts()) {
+ if (flag.contains("-agentpath")) {
+ throw new SkippedException("Can't run test with agent.");
+ }
+ }
+ }
+
private List anyNonWhitelistedJTregVMAndJavaOptsFlags() {
List flags = Arrays.stream(Utils.getTestJavaOpts())
.map(s -> s.replaceFirst("-XX:[+|-]?|-(?=[^D|^e])", ""))
.collect(Collectors.toList());
List nonWhiteListedFlags = new ArrayList();
for (String flag : flags) {
+ if (flag.contains("agentpath")) {
+ throw new SkippedException("Can't run test with -javaagent");
+ }
// Property flags (prefix -D), -ea and -esa are whitelisted.
if (!flag.startsWith("-D") && !flag.startsWith("-e") && JTREG_WHITELIST_FLAGS.stream().noneMatch(flag::contains)) {
// Found VM flag that is not whitelisted
diff --git a/test/jdk/ProblemList-jvmti-stress-agent.txt b/test/jdk/ProblemList-jvmti-stress-agent.txt
new file mode 100644
index 00000000000..4a6e80a9402
--- /dev/null
+++ b/test/jdk/ProblemList-jvmti-stress-agent.txt
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2025, 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.
+#
+
+#############################################################################
+#
+# List of quarantined tests failing with jvmti stress agent in any mode.
+#
+#############################################################################
+
+
+sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java 8362658 generic-all
+sun/security/ssl/SSLSessionImpl/MultiNSTClient.java 8362658 generic-all
+sun/security/ssl/SSLSessionImpl/MultiNSTNoSessionCreation.java 8362658 generic-all
+sun/security/ssl/SSLSessionImpl/MultiNSTParallel.java 8362658 generic-all
+sun/security/ssl/SSLSessionImpl/MultiNSTSequence.java 8362658 generic-all
+sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java 8362658 generic-all
+sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java 8362658 generic-all
+
+
+# List of tests incompatible with jvmti stress agent or requiring more investigation
+
+com/sun/jdi/EATests.java#id0 0000000 generic-all
+com/sun/jdi/ThreadMemoryLeakTest.java 0000000 generic-all
+
+# weak referenced are not cleared
+java/lang/WeakPairMap/Driver.java 0000000 generic-all
+java/lang/ref/ReachabilityFenceTest.java 0000000 generic-all
diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java
index 5ac0bea3937..74ea525b415 100644
--- a/test/jtreg-ext/requires/VMProps.java
+++ b/test/jtreg-ext/requires/VMProps.java
@@ -422,7 +422,12 @@ public class VMProps implements Callable