From e1daaed90b23328362e91c9bdc95fd5c52ddaf14 Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Tue, 29 Jun 2021 14:41:36 +0200 Subject: [PATCH] #6443 wait for handshake to be done before closing the socket Signed-off-by: Ludovic Orban --- .../org/eclipse/jetty/client/ssl/SslBytesServerTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java index 62844065eaf..013dfe7c039 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java @@ -329,7 +329,7 @@ public class SslBytesServerTest extends SslBytesTest final SSLSocket client2 = newClient(proxy); - threadPool.submit(() -> + Future handshakeFuture = threadPool.submit(() -> { client2.startHandshake(); return null; @@ -361,6 +361,9 @@ public class SslBytesServerTest extends SslBytesTest // Client Done TLSRecord doneRecord = proxy.readFromClient(); assertNotNull(doneRecord); + + // Wait for socket to be done with handshake + handshakeFuture.get(5, TimeUnit.SECONDS); // Close client2.close(); TLSRecord closeRecord = proxy.readFromClient();