INT-1884 Fix Sporadically Failing Jdbc Test
This commit is contained in:
@@ -100,7 +100,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test @Ignore
|
||||
@Test
|
||||
@Repeat(10)
|
||||
public void testTransactionalSendAndReceive() throws Exception {
|
||||
|
||||
@@ -130,8 +130,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
|
||||
|
||||
assertTrue("Could not send message", result);
|
||||
|
||||
// So no activation
|
||||
assertEquals(0, Service.messages.size());
|
||||
waitForMessage();
|
||||
|
||||
StopWatch stopWatch = new StopWatch();
|
||||
try {
|
||||
@@ -147,6 +146,18 @@ public class JdbcMessageStoreChannelIntegrationTests {
|
||||
|
||||
}
|
||||
|
||||
protected void waitForMessage() throws InterruptedException {
|
||||
int n = 0;
|
||||
while (Service.messages.size() == 0) {
|
||||
if (n++ > 200) {
|
||||
fail("Message not received by Service");
|
||||
}
|
||||
Thread.sleep(50);
|
||||
}
|
||||
|
||||
assertEquals(1, Service.messages.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSameTransactionSendAndReceive() throws Exception {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user