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());
    }
}

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

Commit messages:
 - change @requires tag to use empty string instead of null

Changes: https://git.openjdk.org/jdk/pull/30350/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30350&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8379672
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/30350.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30350/head:pull/30350

PR: https://git.openjdk.org/jdk/pull/30350

Reply via email to