Skip to content
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

8257997: sun/security/ssl/SSLSocketImpl/SSLSocketLeak.java again reports leaks after JDK-8257884 #1729

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 3 additions & 4 deletions test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketLeak.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@

/*
* @test
* @bug 8256818 8257670 8257884
* @bug 8256818 8257670 8257884 8257997
* @summary Test that creating and closing SSL Sockets without bind/connect
* will not leave leaking socket file descriptors
* @library /test/lib
* @run main/othervm SSLSocketLeak
*/
// Note: this test is not reliable, run it manually.
public class SSLSocketLeak {

// number of sockets to open/close
private static final int NUM_TEST_SOCK = 500;

// percentage of accepted growth of open handles
private static final int OPEN_HANDLE_GROWTH_THRESHOLD = Platform.isWindows() ? 25 : 10;
private static final int OPEN_HANDLE_GROWTH_THRESHOLD_PERCENTAGE = Platform.isWindows() ? 25 : 10;

public static void main(String[] args) throws IOException {
long fds_start = FileUtils.getProcessHandleCount();
Expand All @@ -58,7 +57,7 @@ public static void main(String[] args) throws IOException {
long fds_end = FileUtils.getProcessHandleCount();
System.out.println("FDs in the end: " + fds_end);

if ((fds_end - fds_start) > (NUM_TEST_SOCK / OPEN_HANDLE_GROWTH_THRESHOLD)) {
if ((fds_end - fds_start) > ((NUM_TEST_SOCK * OPEN_HANDLE_GROWTH_THRESHOLD_PERCENTAGE)) / 100) {
throw new RuntimeException("Too many open file descriptors. Looks leaky.");
}
}
Expand Down