this test can take more than 2mins in ci env, adding some more diagnostics and giving it more time

This commit is contained in:
gtully 2015-01-22 13:45:34 +00:00
parent c28d520727
commit 216626569a
1 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import javax.jms.MessageConsumer;
import javax.jms.MessageProducer; import javax.jms.MessageProducer;
import javax.jms.Session; import javax.jms.Session;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.TestSupport;
import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter; import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
import org.junit.After; import org.junit.After;
@ -81,7 +82,7 @@ public class TransactedStoreUsageSuspendResumeTest {
MessageConsumer consumer = session.createConsumer(session.createQueue(QUEUE_NAME)); MessageConsumer consumer = session.createConsumer(session.createQueue(QUEUE_NAME));
do { do {
Message message = consumer.receive(1000); Message message = consumer.receive(5000);
if (message != null) { if (message != null) {
session.commit(); session.commit();
messagesReceivedCountDown.countDown(); messagesReceivedCountDown.countDown();
@ -140,7 +141,10 @@ public class TransactedStoreUsageSuspendResumeTest {
sendExecutor.shutdown(); sendExecutor.shutdown();
sendExecutor.awaitTermination(5, TimeUnit.MINUTES); sendExecutor.awaitTermination(5, TimeUnit.MINUTES);
boolean allMessagesReceived = messagesReceivedCountDown.await(120, TimeUnit.SECONDS); boolean allMessagesReceived = messagesReceivedCountDown.await(10, TimeUnit.MINUTES);
if (!allMessagesReceived) {
TestSupport.dumpAllThreads("StuckConsumer!");
}
assertTrue("Got all messages: " + messagesReceivedCountDown, allMessagesReceived); assertTrue("Got all messages: " + messagesReceivedCountDown, allMessagesReceived);
// give consumers a chance to exit gracefully // give consumers a chance to exit gracefully