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.
This commit is contained in:
Norman Maurer 2015-04-30 21:22:30 +02:00
parent 3642fc4818
commit 879ad145d3

View File

@ -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();