From 93f08aa28bbfb57cd22c381753d02271afcd34fa Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 30 Apr 2015 21:22:30 +0200 Subject: [PATCH] Fix race-condition in SocketSslEchoTest Motivation: Because we tried to grab the SSL renegotation future to early we could see test-failures. Modifications: Access the future at the correct time. Result: No more test-failures. --- .../transport/socket/SocketSslEchoTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 132dce4b10..05b23ec081 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 @@ -304,14 +304,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) { @@ -343,6 +335,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();