From 4905910b7b2cfa35e42a3cab7d6a99f991778bde Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Tue, 19 Aug 2025 05:57:12 +0000 Subject: [PATCH 1/2] Backport f665ad7771e98a06b6fbf1fcfe3b4b92267a9bf9 --- jdk/test/java/net/Socket/B8312065.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jdk/test/java/net/Socket/B8312065.java b/jdk/test/java/net/Socket/B8312065.java index 2df3e82ad2..56d4767d5e 100644 --- a/jdk/test/java/net/Socket/B8312065.java +++ b/jdk/test/java/net/Socket/B8312065.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Alibaba Group Holding Limited. All Rights Reserved. + * Copyright (c) 2023, 2025, Alibaba Group Holding Limited. 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 @@ -26,8 +26,10 @@ * @bug 8312065 * @summary Socket.connect does not timeout as expected when profiling (i.e. keep receiving signal) * @requires (os.family == "linux") - * @build B8312065 - * @run shell B8312065.sh + * @library /test/lib + * @build jtreg.SkippedException + * @compile NativeThread.java + * @run main/othervm/timeout=120 B8312065 */ import sun.misc.Signal; @@ -37,6 +39,8 @@ import java.net.SocketTimeoutException; import java.util.concurrent.TimeUnit; +import jtreg.SkippedException; + public class B8312065 { public static void main(String[] args) throws Exception { System.loadLibrary("NativeThread"); @@ -83,6 +87,8 @@ public static void main(String[] args) throws Exception { System.out.println("Test FAILED: duration " + duration + " ms, expected >= " + timeoutMillis + " ms"); System.exit(1); } + } catch (java.net.ConnectException e) { + throw new SkippedException("Network setup issue, skip this test", e); } } } From 1f2a015e62e854d5fca33514b884966cc274b793 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Thu, 30 Apr 2026 15:18:27 +0800 Subject: [PATCH 2/2] Use the original "@run shell B8312065.sh" --- jdk/test/java/net/Socket/B8312065.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/net/Socket/B8312065.java b/jdk/test/java/net/Socket/B8312065.java index 56d4767d5e..390c97089f 100644 --- a/jdk/test/java/net/Socket/B8312065.java +++ b/jdk/test/java/net/Socket/B8312065.java @@ -28,8 +28,8 @@ * @requires (os.family == "linux") * @library /test/lib * @build jtreg.SkippedException - * @compile NativeThread.java - * @run main/othervm/timeout=120 B8312065 + * @build B8312065 + * @run shell B8312065.sh */ import sun.misc.Signal;