mirror of https://github.com/apache/activemq.git
some more resiliance to slow hardware for this test
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@882510 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0728ec9e75
commit
2a238f7c71
|
@ -37,6 +37,7 @@ import javax.jms.Message;
|
||||||
import javax.jms.MessageConsumer;
|
import javax.jms.MessageConsumer;
|
||||||
import javax.jms.MessageProducer;
|
import javax.jms.MessageProducer;
|
||||||
import javax.jms.Session;
|
import javax.jms.Session;
|
||||||
|
import javax.management.InstanceNotFoundException;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
@ -243,25 +244,27 @@ public class ExpiredMessagesTest extends CombinationTestSupport {
|
||||||
final boolean deleteAllMessages = false;
|
final boolean deleteAllMessages = false;
|
||||||
broker = createBroker(deleteAllMessages, 5000);
|
broker = createBroker(deleteAllMessages, 5000);
|
||||||
|
|
||||||
view = createView(destination);
|
Wait.waitFor(new Wait.Condition() {
|
||||||
LOG.info("Stats: size: " + view.getQueueSize() + ", enqueues: "
|
public boolean isSatisified() throws Exception {
|
||||||
+ view.getDequeueCount() + ", dequeues: "
|
boolean result = false;
|
||||||
+ view.getDequeueCount() + ", dispatched: "
|
try {
|
||||||
+ view.getDispatchCount() + ", inflight: "
|
DestinationViewMBean view = createView(destination);
|
||||||
+ view.getInFlightCount() + ", expiries: "
|
LOG.info("Stats: size: " + view.getQueueSize() + ", enqueues: "
|
||||||
+ view.getExpiredCount());
|
+ view.getDequeueCount() + ", dequeues: "
|
||||||
|
+ view.getDequeueCount() + ", dispatched: "
|
||||||
|
+ view.getDispatchCount() + ", inflight: "
|
||||||
|
+ view.getInFlightCount() + ", expiries: "
|
||||||
|
+ view.getExpiredCount());
|
||||||
|
|
||||||
long expiry = System.currentTimeMillis() + 30000;
|
result = view.getQueueSize() == 0;
|
||||||
while (view.getQueueSize() > 0 && System.currentTimeMillis() < expiry) {
|
} catch (InstanceNotFoundException expectedOnSlowMachines) {
|
||||||
Thread.sleep(500);
|
}
|
||||||
}
|
return result;
|
||||||
LOG.info("Stats: size: " + view.getQueueSize() + ", enqueues: "
|
}
|
||||||
+ view.getDequeueCount() + ", dequeues: "
|
});
|
||||||
+ view.getDequeueCount() + ", dispatched: "
|
|
||||||
+ view.getDispatchCount() + ", inflight: "
|
view = createView(destination);
|
||||||
+ view.getInFlightCount() + ", expiries: "
|
assertEquals("Expect empty queue, QueueSize: ", 0, view.getQueueSize());
|
||||||
+ view.getExpiredCount());
|
|
||||||
assertEquals("Wrong QueueSize: ", 0, view.getQueueSize());
|
|
||||||
assertEquals("all dequeues were expired", view.getDequeueCount(), view.getExpiredCount());
|
assertEquals("all dequeues were expired", view.getDequeueCount(), view.getExpiredCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue