Skip to content

Commit 3eba47b

Browse files
govsriniPaul Hohensee
authored andcommitted
8347173: java/net/DatagramSocket/InterruptibleDatagramSocket.java fails with virtual thread factory
Backport-of: 35be4a432b55070f53a6f1aa74994ffb70f07947
1 parent 8a4953a commit 3eba47b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/jdk/java/net/DatagramSocket/InterruptibleDatagramSocket.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
3737
* @test
3838
* @summary Check interrupt mechanism for DatagramSocket,
3939
* MulticastSocket, and DatagramSocketAdaptor
40+
* @library /test/lib
4041
* @run main InterruptibleDatagramSocket
4142
*/
4243

@@ -97,6 +98,10 @@ else if (!s.isClosed() && interruptible)
9798
}
9899

99100
public static void main(String[] args) throws Exception {
101+
if (Thread.currentThread().isVirtual()) {
102+
throw new jtreg.SkippedException(
103+
"skipping test execution - main thread is a virtual thread");
104+
}
100105
try (DatagramSocket s = new DatagramSocket()) {
101106
System.out.println("Testing interrupt of DatagramSocket receive " +
102107
"on endpoint " + s.getLocalSocketAddress());

0 commit comments

Comments
 (0)