INT-2839 Fix Test Race Condition
A secondary part of the new gateway test was to ensure we reused the cached connection. However, there was a race condition in that the connection may not yet have been returned to the pool by the reader thread that received the response.
This commit is contained in:
@@ -320,6 +320,9 @@ public class CachingClientConnectionFactoryTests {
|
||||
assertNotNull(m);
|
||||
assertEquals("foo:" + "Hello, world!", new String((byte[]) m.getPayload()));
|
||||
|
||||
// wait a short time to allow the connection to be returned to the pool
|
||||
Thread.sleep(1000);
|
||||
|
||||
// assert we use the same connection from the pool
|
||||
toGateway.send(new GenericMessage<String>("Hello, world2!"));
|
||||
m = fromGateway.receive(1000);
|
||||
|
||||
Reference in New Issue
Block a user