Skip to content

Commit f665ad7

Browse files
author
SendaoYan
committed
8350540: [17u,11u] B8312065.java fails Network is unreachable
Backport-of: 75fa2e7c44d52874fa0054889f1240e0c58fcfd1
1 parent 42fb664 commit f665ad7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/jdk/java/net/Socket/B8312065.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Alibaba Group Holding Limited. All Rights Reserved.
2+
* Copyright (c) 2023, 2025, Alibaba Group Holding Limited. 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
@@ -26,6 +26,8 @@
2626
* @bug 8312065
2727
* @summary Socket.connect does not timeout as expected when profiling (i.e. keep receiving signal)
2828
* @requires (os.family != "windows")
29+
* @library /test/lib
30+
* @build jtreg.SkippedException
2931
* @compile NativeThread.java
3032
* @run main/othervm/native/timeout=120 B8312065
3133
*/
@@ -37,6 +39,8 @@
3739
import java.net.SocketTimeoutException;
3840
import java.util.concurrent.TimeUnit;
3941

42+
import jtreg.SkippedException;
43+
4044
public class B8312065 {
4145
public static void main(String[] args) throws Exception {
4246
System.loadLibrary("NativeThread");
@@ -83,6 +87,8 @@ public static void main(String[] args) throws Exception {
8387
System.out.println("Test FAILED: duration " + duration + " ms, expected >= " + timeoutMillis + " ms");
8488
System.exit(1);
8589
}
90+
} catch (java.net.ConnectException e) {
91+
throw new SkippedException("Network setup issue, skip this test", e);
8692
}
8793
}
8894
}

0 commit comments

Comments
 (0)