Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jdk/test/java/net/Socket/B8312065.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -26,6 +26,8 @@
* @bug 8312065
* @summary Socket.connect does not timeout as expected when profiling (i.e. keep receiving signal)
* @requires (os.family == "linux")
* @library /test/lib
* @build jtreg.SkippedException
* @build B8312065
* @run shell B8312065.sh
*/
Expand All @@ -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");
Expand Down Expand Up @@ -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);
}
}
}