On Tue, 7 Apr 2026 05:39:16 GMT, Leonid Mesnik <[email protected]> wrote:

>> The vmTestbase/nsk/jvmti/scenarios/sampling is updated to run testing in the 
>> virtual threads when virtual thread test factory is enabled.
>> 
>> The ThreadWrapper is helper class that allows tests execute not only main 
>> thread but other threads as virtual threads.
>> It is useful for the pattern
>> `class MyThread extends Thread {...}`
>> The plan is to convert more tests  focusing on serviceability tests. Helps 
>> to run more jvmti functions for virtual threads.
>> 
>> Please note that some tests are still not updated because it requires 
>> significant efforts to redesign them. The goal is to update the only simple 
>> cases.
>
> Leonid Mesnik has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - updated doc for ThreadWrapper
>  - reverted some tests that can't be really run with virtual threads

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002.java 
line 79:

> 77:         log.display(">>> starting tested thread");
> 78:         hs201t002Thread wrappedThread = new hs201t002Thread();
> 79:         Thread thread = wrappedThread.getThread();

Is the issue here the resumeThread(thread) call below? Any reason not to just 
pass thread.getThread() to it. It looks like you've done that elsewhere like in 
hs202t001.java

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t001.java 
line 75:

> 73:             threadWrappers[0].getThread(),
> 74:             threadWrappers[1].getThread()
> 75:         };

Why not just call getThread() when needed rather than setting up this array?

test/hotspot/jtreg/vmTestbase/nsk/share/ExtraClassesBuilder.java line 67:

> 65:                                                .addToolArg(dst.toString())
> 66:                                                .addToolArg("-sourcepath")
> 67:                                                
> .addToolArg(Utils.TEST_SRC_PATH)

Why is this needed now?

test/lib/jdk/test/lib/thread/ThreadWrapper.java line 51:

> 49:     @SuppressWarnings("this-escape")
> 50:     public ThreadWrapper() {
> 51:         thread = TestThreadFactory.newThread(this);

A short comment like you have in the PR description would be useful here.

test/lib/jdk/test/lib/thread/ThreadWrapper.java line 53:

> 51:         thread = TestThreadFactory.newThread(this);
> 52:     }
> 53: 

extra newline

test/lib/jdk/test/lib/thread/ThreadWrapper.java line 111:

> 109:     }
> 110: 
> 111: 

extra line

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30591#discussion_r3041385167
PR Review Comment: https://git.openjdk.org/jdk/pull/30591#discussion_r3041400136
PR Review Comment: https://git.openjdk.org/jdk/pull/30591#discussion_r3041408796
PR Review Comment: https://git.openjdk.org/jdk/pull/30591#discussion_r3041427616
PR Review Comment: https://git.openjdk.org/jdk/pull/30591#discussion_r3041418846
PR Review Comment: https://git.openjdk.org/jdk/pull/30591#discussion_r3041410009

Reply via email to