Skip to content

Commit 5a8561a

Browse files
committed
Merge branch 'master' into JDK-8373022_initialheapsize_test_no_gc
2 parents 0f85529 + 4d696d0 commit 5a8561a

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

make/RunTests.gmk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -873,16 +873,16 @@ define SetupRunJtregTestBody
873873
$1_JTREG_BASIC_OPTIONS += -testThreadFactoryPath:$$(JTREG_TEST_THREAD_FACTORY_JAR)
874874
$1_JTREG_BASIC_OPTIONS += -testThreadFactory:$$(JTREG_TEST_THREAD_FACTORY)
875875
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
876-
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-$$(JTREG_TEST_THREAD_FACTORY).txt) \
876+
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-$$(JTREG_TEST_THREAD_FACTORY).txt) \
877877
))
878878
endif
879879

880880
ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
881881
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
882882
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:$(TEST_IMAGE_DIR)/hotspot/jtreg/native/$$(AGENT)'
883883
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
884-
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
885-
))
884+
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
885+
))
886886
endif
887887

888888

@@ -1092,7 +1092,7 @@ define SetupRunJtregTestBody
10921092
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
10931093
$$($1_TEST_TMP_DIR))
10941094
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
1095-
$$(COV_ENVIRONMENT) $$($1_COMMAND_LINE) \
1095+
$$(COV_ENVIRONMENT) $$($1_COMMAND_LINE) \
10961096
)
10971097

10981098
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt
@@ -1102,11 +1102,11 @@ define SetupRunJtregTestBody
11021102
$$(call LogWarn, Test report is stored in $$(strip \
11031103
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
11041104

1105-
# Read jtreg documentation to learn on the test stats categories:
1106-
# https://github.com/openjdk/jtreg/blob/master/src/share/doc/javatest/regtest/faq.md#what-do-all-those-numbers-in-the-test-results-line-mean
1107-
# In jtreg, "skipped:" category accounts for tests that threw jtreg.SkippedException at runtime.
1108-
# At the same time these tests contribute to "passed:" tests.
1109-
# In here we don't want that and so we substract number of "skipped:" from "passed:".
1105+
# Read jtreg documentation to learn on the test stats categories:
1106+
# https://github.com/openjdk/jtreg/blob/master/src/share/doc/javatest/regtest/faq.md#what-do-all-those-numbers-in-the-test-results-line-mean
1107+
# In jtreg, "skipped:" category accounts for tests that threw jtreg.SkippedException at runtime.
1108+
# At the same time these tests contribute to "passed:" tests.
1109+
# In here we don't want that and so we substract number of "skipped:" from "passed:".
11101110

11111111
$$(if $$(wildcard $$($1_RESULT_FILE)), \
11121112
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \

src/jdk.jdi/share/classes/com/sun/tools/jdi/EventSetImpl.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2025, 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
@@ -37,6 +37,7 @@
3737
import com.sun.jdi.Locatable;
3838
import com.sun.jdi.Location;
3939
import com.sun.jdi.Method;
40+
import com.sun.jdi.ObjectCollectedException;
4041
import com.sun.jdi.ObjectReference;
4142
import com.sun.jdi.ReferenceType;
4243
import com.sun.jdi.ThreadReference;
@@ -206,6 +207,19 @@ public String toString() {
206207

207208
}
208209

210+
/* Safely fetch the thread name in case there is an ObjectCollectedException.
211+
* This can happen when dealing with SUSPEND_NONE events.
212+
*/
213+
private static String getThreadName(ThreadReference thread) {
214+
String name;
215+
try {
216+
name = thread.name();
217+
} catch (ObjectCollectedException oce) {
218+
name = "<thread collected>";
219+
}
220+
return name;
221+
}
222+
209223
abstract class ThreadedEventImpl extends EventImpl {
210224
private ThreadReference thread;
211225

@@ -220,7 +234,7 @@ public ThreadReference thread() {
220234
}
221235

222236
public String toString() {
223-
return eventName() + " in thread " + thread.name();
237+
return eventName() + " in thread " + getThreadName(thread);
224238
}
225239
}
226240

@@ -249,7 +263,7 @@ public Method method() {
249263
public String toString() {
250264
return eventName() + "@" +
251265
((location() == null) ? " null" : location().toString()) +
252-
" in thread " + thread().name();
266+
" in thread " + getThreadName(thread());
253267
}
254268
}
255269

test/hotspot/jtreg/ProblemList.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,3 @@ vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEa
184184
vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Multi/Multi005/TestDescription.java 8076494 windows-x64
185185

186186
vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find006/TestDescription.java 8310144 macosx-aarch64
187-
188-
vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001/TestDescription.java 8373022 generic-all
189-
vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded002/TestDescription.java 8373022 generic-all
190-
vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded003/TestDescription.java 8373022 generic-all
191-
vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded004/TestDescription.java 8373022 generic-all
192-
vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded005/TestDescription.java 8373022 generic-all

test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public static int run(String[] argv, PrintStream out) {
9292
// but cannot assume this affects the pool we are testing.
9393
b = new byte[INCREMENT];
9494

95-
isExceeded = monitor.isUsageThresholdExceeded(pool);
95+
// Ensure the observation of isExceeded is sticky to match peakUsage.
96+
isExceeded = isExceeded || monitor.isUsageThresholdExceeded(pool);
9697
log.display(" Allocated heap. isExceeded = " + isExceeded);
9798

9899
// Fetch usage information: use peak usage in comparisons below, in case usage went up and then down.

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ javax/swing/plaf/synth/7158712/bug7158712.java 8324782 macosx-all
716716
# jdk_jdi
717717

718718
com/sun/jdi/InvokeHangTest.java 8218463 linux-all
719-
com/sun/jdi/MethodInvokeWithTraceOnTest.java 8373022 generic-all
720719

721720
############################################################################
722721

0 commit comments

Comments
 (0)