On Fri, 20 Mar 2026 22:32:41 GMT, Brent Christian <[email protected]> wrote:
> I've looked into it, and if `@requires` uses `""` instead of `null`, these
> other run modes (`jtreg` and `make test`) will also skip the test (`"Test
> results: no tests selected"`). (Thanks to @dholmes-ora for the idea.)
>
> From the bug report:
> It's worth noting that only the method of running tests from the original bug
> (`jib.sh make -- run-test JTREG_TEST_THREAD_FACTORY=Virtual TEST=...`)
> actually causes tests to be run with virtual threads;
> it sets the thread factory to virtual **_in the jtreg process_**.
>
> This is not so for
> `jtreg ... -javaoptions:-Dtest.thread.factory=Virtual ...`
> or
> `make test ... JTREG="JAVA_OPTIONS=-Dtest.thread.factory=Virtual" ...`
>
> One can confirm this with a small test such as:
>
>
> /**
> * @test
> * @run main/othervm VirtThreadCheck
> */
> public class VirtThreadCheck {
> public static void main(String[] args) {
> Thread thisThread = Thread.currentThread();
> System.out.println("main thread is: " + thisThread);
> System.out.println("virtual? : " + thisThread.isVirtual());
> }
> }
This pull request has now been integrated.
Changeset: 2afd7b8b
Author: Brent Christian <[email protected]>
URL:
https://git.openjdk.org/jdk/commit/2afd7b8b1459951fd476f0e9b0b8e1845c97890d
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
8379672: jdk/internal/misc/VM/RuntimeArguments.java test still fails in Virtual
threads mode after JDK-8373718
Reviewed-by: jpai
-------------
PR: https://git.openjdk.org/jdk/pull/30350