On Tue, 11 Jun 2024 21:05:38 GMT, Inigo Mediavilla Saiz <d...@openjdk.org> 
wrote:

>> Print the stack traces of mounted virtual threads when calling `jcmd <pid> 
>> Thread.print`.
>
> Inigo Mediavilla Saiz has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Require continuations to run the test

test/hotspot/jtreg/serviceability/dcmd/thread/PrintMountedVirtualThread.java 
line 54:

> 52:         output.shouldMatch(".*at " + 
> Pattern.quote(DummyRunnable.class.getName()) + "\\.compute.*");
> 53:         output.shouldMatch("Mounted virtual thread " + "\"Dummy 
> Vthread\"" + " #" + vthread.threadId());
> 54:         shouldFinish.set(true);

One other suggestion is to use a try-finally block here. Put L48-53 in the 
block and set shouldFinish in the finally block. That way if the test fails 
then it won't leave a spinning thread to disrupt the next test that runs in the 
agent VM.

Also just to say that we've mostly used JUnit for new tests in recent releases, 
moving away from TestNG for new tests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19482#discussion_r1635872465

Reply via email to