fix flakey qos test

the qos autotest required initially for us to wait for messages to
be added to the queue before running the test, and this was flakey
at best. these changes make it much more dependable
This commit is contained in:
Matt Broadstone 2014-07-28 12:58:37 -04:00
parent fa132d7c72
commit 4a0fa8bf9c
1 changed files with 3 additions and 4 deletions

View File

@ -436,6 +436,8 @@ void tst_QAMQPQueue::qos()
QVERIFY(waitForSignal(queue, SIGNAL(qosDefined())));
QCOMPARE(queue->prefetchCount(), qint16(1));
QCOMPARE(queue->prefetchSize(), 0);
QVERIFY(queue->consume());
QVERIFY(waitForSignal(queue, SIGNAL(consuming(QString))));
// load up the queue
const int messageCount = 10;
@ -445,10 +447,7 @@ void tst_QAMQPQueue::qos()
defaultExchange->publish(message, "test-qos");
}
// begin consuming, one at a time
QVERIFY(queue->consume());
QVERIFY(waitForSignal(queue, SIGNAL(consuming(QString))));
QVERIFY(waitForSignal(queue, SIGNAL(messageReceived())));
int messageReceivedCount = 0;
while (!queue->isEmpty()) {
QString expected = QString("message %1").arg(messageReceivedCount);