8338714: vmTestbase/nsk/jdb/kill/kill001/kill001.java fails with JTREG_TEST_THREAD_FACTORY=Virtual

Reviewed-by: sspitsyn, dholmes
This commit is contained in:
Chris Plummer 2024-12-17 19:06:07 +00:00
parent dc71e8cae9
commit 414eb6bb83
3 changed files with 17 additions and 11 deletions

View File

@ -87,19 +87,10 @@ vmTestbase/nsk/jdi/ExceptionEvent/catchLocation/location002/TestDescription.java
vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8285417 generic-all
###
# The test first suspends a vthread and all the carriers and then it resumes the vthread expecting it
# to run to completion. In mainline it only works because the suspension step happens while the vthread is
# pinned to the carrier blocked on synchronized. So the carrier only actually suspends on the next unmount
# transition which in this test happens once the vthread has finished executing the expected code.
# Fails because resume of a virtual thread is not enough to allow the virtual thread
# to make progress when all other threads are currently suspended.
vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002/TestDescription.java 8338713 generic-all
###
# The test sends a StopThread to a vthread expecting that is currently pinned to the carrier blocked on
# synchronized. Since the vthread is now unmounted StopThread returns JVMTI_ERROR_OPAQUE_FRAME error.
vmTestbase/nsk/jdb/kill/kill001/kill001.java 8338714 generic-all
###
# Fails on Windows because of additional memory allocation.

View File

@ -27,6 +27,7 @@ import nsk.share.*;
import nsk.share.jpda.*;
import nsk.share.jdb.*;
import nsk.share.jdi.JDIThreadFactory;
import jdk.test.lib.thread.VThreadPinner;
import java.io.*;
import java.util.*;
@ -152,6 +153,17 @@ class MyThread extends Thread {
}
public void run() {
boolean vthreadMode = "Virtual".equals(System.getProperty("test.thread.factory"));
if (vthreadMode) {
// JVMTI StopThread is only supported for mounted virtual threads. We need to
// pin the virtual threads so they remain mounted.
VThreadPinner.runPinned(() -> test());
} else {
test();
}
}
public void test() {
// Concatenate strings in advance to avoid lambda calculations later
String ThreadFinished = "Thread finished: " + this.name;
String CaughtExpected = "Thread " + this.name + " caught expected async exception: " + expectedException;

View File

@ -137,6 +137,9 @@ public class Launcher extends DebugeeBinder {
/* Some tests need more carrier threads than the default provided. */
args.add("-R-Djdk.virtualThreadScheduler.parallelism=15");
}
/* Some jdb tests need java.library.path setup for native libraries. */
String libpath = System.getProperty("java.library.path");
args.add("-R-Djava.library.path=" + libpath);
}
args.addAll(argumentHandler.enwrapJavaOptions(argumentHandler.getJavaOptions()));