8356114: java/foreign/TestBufferStackStress2.java failed with junit action timed out

Reviewed-by: djelinski, alanb
This commit is contained in:
Per Minborg 2025-05-07 09:12:44 +00:00
parent 50554fa198
commit 1bdff3ccd0

View File

@ -29,6 +29,7 @@
*/
import jdk.internal.foreign.BufferStack;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import java.io.FileDescriptor;
@ -62,6 +63,14 @@ final class TestBufferStackStress2 {
*/
@Test
void movingVirtualThreadWithGc() throws InterruptedException {
// If the VM is configured such that the main thread is virtual,
// this stress test will not work as the main thread is always alive causing
// us to wait forever for contraction.
// Hence, we will skip this test if the main thread is virtual.
Assumptions.assumeFalse(Thread.currentThread().isVirtual(),
"Skipped because the main thread is a virtual thread");
final long begin = System.nanoTime();
var pool = BufferStack.of(POOL_SIZE, 1);