File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
test/jdk/sun/security/ssl/SSLSocketImpl Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 31
31
32
32
/*
33
33
* @test
34
- * @bug 8256818 8257670 8257884
34
+ * @bug 8256818 8257670 8257884 8257997
35
35
* @summary Test that creating and closing SSL Sockets without bind/connect
36
36
* will not leave leaking socket file descriptors
37
37
* @library /test/lib
38
38
* @run main/othervm SSLSocketLeak
39
39
*/
40
- // Note: this test is not reliable, run it manually.
41
40
public class SSLSocketLeak {
42
41
43
42
// number of sockets to open/close
44
43
private static final int NUM_TEST_SOCK = 500 ;
45
44
46
45
// 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 ;
48
47
49
48
public static void main (String [] args ) throws IOException {
50
49
long fds_start = FileUtils .getProcessHandleCount ();
@@ -58,7 +57,7 @@ public static void main(String[] args) throws IOException {
58
57
long fds_end = FileUtils .getProcessHandleCount ();
59
58
System .out .println ("FDs in the end: " + fds_end );
60
59
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 ) {
62
61
throw new RuntimeException ("Too many open file descriptors. Looks leaky." );
63
62
}
64
63
}
You can’t perform that action at this time.
0 commit comments