INT-1884 Fix Sporadically Failing Jdbc Test
This commit is contained in:
@@ -100,7 +100,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test @Ignore
|
@Test
|
||||||
@Repeat(10)
|
@Repeat(10)
|
||||||
public void testTransactionalSendAndReceive() throws Exception {
|
public void testTransactionalSendAndReceive() throws Exception {
|
||||||
|
|
||||||
@@ -130,8 +130,7 @@ public class JdbcMessageStoreChannelIntegrationTests {
|
|||||||
|
|
||||||
assertTrue("Could not send message", result);
|
assertTrue("Could not send message", result);
|
||||||
|
|
||||||
// So no activation
|
waitForMessage();
|
||||||
assertEquals(0, Service.messages.size());
|
|
||||||
|
|
||||||
StopWatch stopWatch = new StopWatch();
|
StopWatch stopWatch = new StopWatch();
|
||||||
try {
|
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
|
@Test
|
||||||
public void testSameTransactionSendAndReceive() throws Exception {
|
public void testSameTransactionSendAndReceive() throws Exception {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user