NO-JIRA Fix tests that fail on loaded system

Tests that can fail on loaded system due to not waiting for metrics
updates.
This commit is contained in:
Timothy Bish 2017-08-23 10:51:31 -04:00
parent a85e75daa1
commit 9021e0301d
2 changed files with 4 additions and 3 deletions

View File

@ -59,7 +59,7 @@ public class AmqpDescribedTypePayloadTest extends JMSClientTestSupport {
sender.close();
Queue queue = getProxyToQueue(getQueueName());
assertEquals(1, queue.getMessageCount());
assertTrue("Should be one message on Queue.", Wait.waitFor(() -> queue.getMessageCount() == 1));
AmqpReceiver receiver = session.createReceiver(getQueueName());
receiver.flow(1);
@ -86,7 +86,7 @@ public class AmqpDescribedTypePayloadTest extends JMSClientTestSupport {
connection.close();
Queue queue = getProxyToQueue(getQueueName());
assertEquals(1, queue.getMessageCount());
assertTrue("Should be one message on Queue.", Wait.waitFor(() -> queue.getMessageCount() == 1));
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(getBrokerOpenWireConnectionURI());
Connection jmsConnection = factory.createConnection();

View File

@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
import org.apache.activemq.artemis.tests.util.Wait;
import org.apache.activemq.transport.amqp.client.AmqpClient;
import org.apache.activemq.transport.amqp.client.AmqpConnection;
import org.apache.activemq.transport.amqp.client.AmqpMessage;
@ -62,7 +63,7 @@ public class AmqpReceiverDrainTest extends AmqpClientTestSupport {
Queue queueView = getProxyToQueue(destinationName);
assertEquals(MSG_COUNT, queueView.getMessageCount());
assertTrue("Messages did not get queued", Wait.waitFor(() -> queueView.getMessageCount() == MSG_COUNT));
assertEquals(0, queueView.getDeliveringCount());
receiver.drain(MSG_COUNT);