AMQ2584Test was failing on linux due to kahadb taking too long to complete. Scaled the test back a bit

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1483963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-05-17 19:54:09 +00:00
parent 1ee9848d9b
commit be7cef6438
1 changed files with 7 additions and 5 deletions

View File

@ -58,7 +58,7 @@ public class AMQ2584Test extends org.apache.activemq.TestSupport {
ActiveMQConnection consumerConnection = null, producerConnection = null;
Session producerSession;
MessageProducer producer;
final int minPercentUsageForStore = 10;
final int minPercentUsageForStore = 3;
String data;
private final TestSupport.PersistenceAdapterChoice persistenceAdapterChoice;
@ -80,12 +80,13 @@ public class AMQ2584Test extends org.apache.activemq.TestSupport {
@Test(timeout = 120000)
public void testSize() throws Exception {
CountDownLatch redeliveryConsumerLatch = new CountDownLatch(15000 -1);
int messages = 1000;
CountDownLatch redeliveryConsumerLatch = new CountDownLatch((messages*3) -1);
openConsumer(redeliveryConsumerLatch);
assertEquals(0, broker.getAdminView().getStorePercentUsage());
for (int i = 0; i < 5000; i++) {
for (int i = 0; i < messages; i++) {
sendMessage(false);
}
@ -93,13 +94,14 @@ public class AMQ2584Test extends org.apache.activemq.TestSupport {
broker.getSystemUsage().getStoreUsage().isFull();
LOG.info("store percent usage: "+brokerView.getStorePercentUsage());
assertTrue("some store in use", broker.getAdminView().getStorePercentUsage() > minPercentUsageForStore);
int storePercentUsage = broker.getAdminView().getStorePercentUsage();
assertTrue("some store in use", storePercentUsage > minPercentUsageForStore);
assertTrue("redelivery consumer got all it needs", redeliveryConsumerLatch.await(60, TimeUnit.SECONDS));
closeConsumer();
// consume from DLQ
final CountDownLatch received = new CountDownLatch(5000 -1);
final CountDownLatch received = new CountDownLatch(messages -1);
consumerConnection = (ActiveMQConnection) createConnection();
Session dlqSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer dlqConsumer = dlqSession.createConsumer(new ActiveMQQueue("ActiveMQ.DLQ"));