Skip to content

8350540: [17u,11u] B8312065.java fails Network is unreachable #3293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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 test/jdk/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 != "windows")
* @library /test/lib
* @build jtreg.SkippedException
* @compile NativeThread.java
* @run main/othervm/native/timeout=120 -Djdk.net.usePlainSocketImpl B8312065
*/
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);
}
}
}