-
Enhancement
-
Resolution: Fixed
-
P3
-
25
-
b20
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8370772 | 21.0.10 | Goetz Lindenmaier | P3 | Resolved | Fixed | master |
The changes recommended for this CR will reduce the number of tests that need to specify includevirtualthreads=y from about 350 to about 180. It does not make the change to have the default be includevirtualthreads=n, which will be left for
The changes in this PR relate to a common pattern in the nsk/jdi tests:
String bPointMethod = "methodForCommunication";
String lineForComm = "lineForComm";
ThreadReference mainThread = debuggee.threadByNameOrThrow("main");
BreakpointRequest bpRequest = settingBreakpoint(mainThread,
debuggeeClass,
bPointMethod, lineForComm, "zero");
All tests that do this require includevirtualthreads=y because of the thread lookup. There is no need for mainThread in this code. null can be used instead for a global breakpoint. Once this is done, there is usually no need to run the test with includevirtualthreads=y, although in a few tests there are other calls to thread lookup API that result in the test still needing includevirtualthreads=y.
I replaced the above code with a call to a new API in JDIBase:
setupBreakpointForCommunication(debuggeeClass);
This represents the bulk of the changes in this CR. Some tests had other references to mainThread that then needed to be addressed. For most, the thread was already stored in bpEvent and could be fetched from there:
breakpointForCommunication();
ThreadReference mainThread = bpEvent.thread(); // bpEvent saved by breakpointForCommunication()
There are a couple of tests where the above changes can be applied, but they have other special needs and will be addressed in separate CRs:
vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter002.java
vmTestbase/nsk/jdi/EventRequest/disable/disable001.java
- backported by
-
JDK-8370772 Fix nsk/jdi test to not require lookup of main thread in order to set the breakpoint used for communication
-
- Resolved
-
- relates to
-
JDK-8355211 nsk/jdi/EventRequest/disable/disable001.java should use JDIBase superclass
-
- Resolved
-
-
JDK-8355214 nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001.java should use JDIBase superclass
-
- Resolved
-
-
JDK-8353955 nsk/jdi tests should be fixed to not always require includevirtualthreads=y
-
- Resolved
-
- links to
-
Commit(master)
openjdk/jdk21u-dev/81356485
-
Commit(master)
openjdk/jdk/b7e8952a
-
Review(master)
openjdk/jdk21u-dev/2404
-
Review(master)
openjdk/jdk/24768