The serviceability/jvmti/vthread/GetThreadStateMountedTest/GetThreadStateMountedTest.java test fails when run with libgraal and the -Xcomp flag. It expects compilation to complete faster than a debug build of libgraal can achieve.
The wait time in the test's native code should be increased when -Xcomp is enabled. For example, the following patch allows the test to pass:
diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp b/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
index 4de5ebe1e89..77fdda77cf3 100644
--- a/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
+++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
@@ -55,7 +55,7 @@ Java_GetThreadStateMountedTest_trySuspendInWaitingState(JNIEnv* jni, jclass claz
const int max_retries = 10;
for (int i = 0; i < max_retries; i++) {
// wait a bit
- sleep_ms(100);
+ sleep_ms(1000);
// suspend the thread
LOG("suspend vthread (%d)\n", i);
The wait time in the test's native code should be increased when -Xcomp is enabled. For example, the following patch allows the test to pass:
diff --git a/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp b/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
index 4de5ebe1e89..77fdda77cf3 100644
--- a/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
+++ b/test/hotspot/jtreg/serviceability/jvmti/vthread/GetThreadStateMountedTest/libGetThreadStateMountedTest.cpp
@@ -55,7 +55,7 @@ Java_GetThreadStateMountedTest_trySuspendInWaitingState(JNIEnv* jni, jclass claz
const int max_retries = 10;
for (int i = 0; i < max_retries; i++) {
// wait a bit
- sleep_ms(100);
+ sleep_ms(1000);
// suspend the thread
LOG("suspend vthread (%d)\n", i);