RFR: 8289607: Change com/sun/jdi tests to not use Thread.suspend/resume [v2]
Chris Plummer
cjplummer at openjdk.org
Tue Sep 20 21:43:34 UTC 2022
On Tue, 20 Sep 2022 00:36:38 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> The Thread.suspend/resume is replaced by JVM TI SuspendThread/ResumeThread whether it is possible.
>> Testcase from test test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001.java was removed because only one environment can suspend threads so debugger is not compatible with JVM TI agent suspending test.
>>
>> Test test/hotspot/jtreg/runtime/handshake/HandshakeSuspendExitTest.java starts failing because it got JVMTI_ERROR_INTERNAL. The problem is that JvmtiSuspendControl::resume() returned false. However, it might happen only if the thread is not suspended, which means that it should be JVMTI_ERROR_THREAD_NOT_SUSPENDED.
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>
> revert changes
> Testcase from test test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001.java was removed because only one environment can suspend threads so debugger is not compatible with JVM TI agent suspending test.
As far as I know, this is the only test we have for ThreadReference.interrupt(). Also see [JDK-8282384](https://bugs.openjdk.org/browse/JDK-8282384), which points out that we have no test for ThreadReference.interrupt() of a virtual thread, and suggests modifying this test to support virtual threads. I actually attempted to do this, but ran into an issue with ThreadReference.resume() support for virtual threads, although I'm not sure what that issue was, and it may be fixed now.
-------------
PR: https://git.openjdk.org/jdk/pull/10351
More information about the serviceability-dev
mailing list