From be7cef64382f871b19c40db086198c53f0055af7 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Fri, 17 May 2013 19:54:09 +0000 Subject: [PATCH] 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 --- .../java/org/apache/activemq/bugs/AMQ2584Test.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java index 17a37c4031..8d3775fbd7 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2584Test.java @@ -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"));