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 cf66edb3a1
commit b0a30cbf39

View File

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