Fix random test failures in TcpClientOutputTest and TcpConnectionTest
testInvalidCommand in TcpClientOutputTest used to fail randomly as two threads working on each side of the socket connection while the socket gets closed due to the invalid command. This is now fixed by * don't read data at the remote socket at all, this is not required by the test case, * wait until all data has been consumed by the TcpClientOutput before the connection is shut down. testRemoteClose in TcpConnectionTest and in TcpClientOutputTest used to fail randomly as two threads working on each side of the socket connection while the socket gets closed. This is now fixed by waiting until the header is fully read before the socket is closed. To avoid lock situations in MockServerConnection the lock must be notified when the internal buffer is decreased.
Loading
Please sign in to comment