On Wed, 6 Sep 2023 20:02:44 GMT, Alex Menkov <amen...@openjdk.org> wrote:

> To test ForceEarlyReturn command for NO_MORE_FRAMES case the test creates 
> ThreadStartEventRequest with SUSPEND_ALL policy and requests debuggee to 
> start new thread.
> If debuggee JVM starts some internal threads before the request is cleared 
> (i.e. we have several ThreadStart events), 2nd event suspends debuggee again 
> and the test fails with timeout.
> The change adds THREAD_ONLY modifier to the ThreadStartEventRequest to 
> generate event only for desired thread.
> It requires thread ID, so debuggee was updated to create Thread object in 
> advance, debugger reads the thread ID from static field (it does not need to 
> be static, but Debugee class has convenient methods to retrieve class ID and 
> static field value).
> 
> Testing: 100 runs of the test on 
> windows-x64-debug,linux-x64-debug,macosx-x64-debug with 
> JTREG_TEST_THREAD_FACTORY=Virtual, with and without "-XX:+UseZGC 
> -XX:+ZGenerational"

Overall looks good. Just one minor comment suggestion.

test/hotspot/jtreg/vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java
 line 164:

> 162:             command.addByte(JDWP.EventKind.THREAD_START);
> 163:             command.addByte(JDWP.SuspendPolicy.ALL);
> 164:             // THREAD_ONLY modifier

Maybe add a bit more of a comment here that explains we only want the 
THREAD_START event for the specified test thread and not any others that might 
start up.

-------------

Marked as reviewed by cjplummer (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15601#pullrequestreview-1614398877
PR Review Comment: https://git.openjdk.org/jdk/pull/15601#discussion_r1317959286

Reply via email to