8347171: (dc) java/nio/channels/DatagramChannel/InterruptibleOrNot.java fails with virtual thread factory

Reviewed-by: alanb, lmesnik
This commit is contained in:
Brian Burkhalter 2025-01-09 15:26:38 +00:00
parent 72f1114909
commit 1ef77cdd51

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -47,6 +47,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.function.Executable;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assumptions.*;
public class InterruptibleOrNot {
// DatagramChannel implementation class
@ -98,6 +99,7 @@ public class InterruptibleOrNot {
*/
@Test
public void testInterruptBeforeUninterruptibleReceive() throws Exception {
assumeFalse(Thread.currentThread().isVirtual());
try (DatagramChannel dc = boundDatagramChannel(false)) {
ByteBuffer buf = ByteBuffer.allocate(100);
onReceive(() -> {