guarantee frames are written
wait for the END frame to be written, guaranteeing that data will be written when you think it has been.
This commit is contained in:
parent
5d00b2a068
commit
fa132d7c72
|
|
@ -57,6 +57,7 @@ void Base::writeHeader(QDataStream &stream) const
|
||||||
void Base::writeEnd(QDataStream &stream) const
|
void Base::writeEnd(QDataStream &stream) const
|
||||||
{
|
{
|
||||||
stream << qint8(FRAME_END);
|
stream << qint8(FRAME_END);
|
||||||
|
stream.device()->waitForBytesWritten(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Base::writePayload(QDataStream &stream) const
|
void Base::writePayload(QDataStream &stream) const
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ void tst_QAMQPExchange::invalidRedeclaration()
|
||||||
|
|
||||||
// this is per spec:
|
// this is per spec:
|
||||||
// QCOMPARE(redeclared->error(), QAMQP::NotAllowedError);
|
// QCOMPARE(redeclared->error(), QAMQP::NotAllowedError);
|
||||||
|
|
||||||
// this is for rabbitmq:
|
// this is for rabbitmq:
|
||||||
QCOMPARE(redeclared->error(), QAMQP::PreconditionFailedError);
|
QCOMPARE(redeclared->error(), QAMQP::PreconditionFailedError);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -367,9 +367,6 @@ void tst_QAMQPQueue::get()
|
||||||
defaultExchange->publish(expected, "test-get");
|
defaultExchange->publish(expected, "test-get");
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait for messages to be delivered
|
|
||||||
QTest::qWait(25);
|
|
||||||
|
|
||||||
for (int i = 0; i < messageCount; ++i) {
|
for (int i = 0; i < messageCount; ++i) {
|
||||||
QString expected = QString("message %1").arg(i);
|
QString expected = QString("message %1").arg(i);
|
||||||
queue->get(false);
|
queue->get(false);
|
||||||
|
|
@ -448,8 +445,6 @@ void tst_QAMQPQueue::qos()
|
||||||
defaultExchange->publish(message, "test-qos");
|
defaultExchange->publish(message, "test-qos");
|
||||||
}
|
}
|
||||||
|
|
||||||
QTest::qWait(100);
|
|
||||||
|
|
||||||
// begin consuming, one at a time
|
// begin consuming, one at a time
|
||||||
QVERIFY(queue->consume());
|
QVERIFY(queue->consume());
|
||||||
QVERIFY(waitForSignal(queue, SIGNAL(consuming(QString))));
|
QVERIFY(waitForSignal(queue, SIGNAL(consuming(QString))));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue