8189646: sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java failed with "java.net.SocketTimeoutException: Read timed out"
authorrobm
Tue, 21 Nov 2017 21:01:23 +0000
changeset 47874 a7d101e56b36
parent 47873 7944849362f3
child 47876 5d4864563be7
8189646: sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java failed with "java.net.SocketTimeoutException: Read timed out" Reviewed-by: coffeys
test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java
--- a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java	Tue Nov 21 10:26:45 2017 +0100
+++ b/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java	Tue Nov 21 21:01:23 2017 +0000
@@ -100,8 +100,11 @@
          */
         serverReady = true;
 
+        System.err.println("Server accepting: " + System.nanoTime());
         SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept();
+        System.err.println("Server accepted: " + System.nanoTime());
         sslSocket.startHandshake();
+        System.err.println("Server handshake complete: " + System.nanoTime());
         while (!clientClosed) {
             Thread.sleep(500);
         }
@@ -123,10 +126,11 @@
         while (!serverReady) {
             Thread.sleep(50);
         }
+        Thread.sleep(500);
         System.out.println("server ready");
 
         Socket baseSocket = new Socket("localhost", serverPort);
-        baseSocket.setSoTimeout(100);
+        baseSocket.setSoTimeout(1000);
 
         SSLSocketFactory sslsf =
             (SSLSocketFactory) SSLSocketFactory.getDefault();
@@ -134,15 +138,16 @@
             sslsf.createSocket(baseSocket, "localhost", serverPort, false);
 
         // handshaking
+        System.err.println("Client starting handshake: " + System.nanoTime());
         sslSocket.startHandshake();
-        System.out.println("handshake done");
+        System.err.println("Client handshake done: " + System.nanoTime());
 
         Thread.sleep(500);
-        System.out.println("client closing");
+        System.err.println("Client closing: " + System.nanoTime());
 
         sslSocket.close();
         clientClosed = true;
-        System.out.println("client closed");
+        System.err.println("Client closed: " + System.nanoTime());
     }
 
     /*