Skip to content

Commit 29ffffa

Browse files
committed
8257997: sun/security/ssl/SSLSocketImpl/SSLSocketLeak.java again reports leaks after JDK-8257884
Reviewed-by: mbaesken
1 parent db5da96 commit 29ffffa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketLeak.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,19 @@
3131

3232
/*
3333
* @test
34-
* @bug 8256818 8257670 8257884
34+
* @bug 8256818 8257670 8257884 8257997
3535
* @summary Test that creating and closing SSL Sockets without bind/connect
3636
* will not leave leaking socket file descriptors
3737
* @library /test/lib
3838
* @run main/othervm SSLSocketLeak
3939
*/
40-
// Note: this test is not reliable, run it manually.
4140
public class SSLSocketLeak {
4241

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

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

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

61-
if ((fds_end - fds_start) > (NUM_TEST_SOCK / OPEN_HANDLE_GROWTH_THRESHOLD)) {
60+
if ((fds_end - fds_start) > ((NUM_TEST_SOCK * OPEN_HANDLE_GROWTH_THRESHOLD_PERCENTAGE)) / 100) {
6261
throw new RuntimeException("Too many open file descriptors. Looks leaky.");
6362
}
6463
}

0 commit comments

Comments
 (0)