diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java index f57bad3f29..8677207d5d 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java @@ -280,14 +280,6 @@ public class SocketSslEchoTest extends AbstractSocketTest { } } - // Wait until renegotiation is done. - if (renegoFuture != null) { - renegoFuture.sync(); - } - if (serverHandler.renegoFuture != null) { - serverHandler.renegoFuture.sync(); - } - // Ensure all data has been exchanged. while (clientRecvCounter.get() < data.length) { if (serverException.get() != null) { @@ -319,6 +311,14 @@ public class SocketSslEchoTest extends AbstractSocketTest { } } + // Wait until renegotiation is done. + if (renegoFuture != null) { + renegoFuture.sync(); + } + if (serverHandler.renegoFuture != null) { + serverHandler.renegoFuture.sync(); + } + serverChannel.close().awaitUninterruptibly(); clientChannel.close().awaitUninterruptibly(); sc.close().awaitUninterruptibly();