Make autotest more resilient against network timeout
(cherry picked from commit 50be38737507f5c23b4d050e635a200024164a13)
This commit is contained in:
parent
f55563e7df
commit
5a7409a423
@ -424,15 +424,17 @@ bool BaselineProtocol::requestBaselineChecksums(const QString &testFunction, Ima
|
|||||||
it->testFunction = testFunction;
|
it->testFunction = testFunction;
|
||||||
|
|
||||||
QByteArray block;
|
QByteArray block;
|
||||||
QDataStream ds(&block, QIODevice::ReadWrite);
|
QDataStream ds(&block, QIODevice::WriteOnly);
|
||||||
ds << *itemList;
|
ds << *itemList;
|
||||||
if (!sendBlock(RequestBaselineChecksums, block))
|
if (!sendBlock(RequestBaselineChecksums, block))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Command cmd;
|
Command cmd;
|
||||||
if (!receiveBlock(&cmd, &block))
|
QByteArray rcvBlock;
|
||||||
|
if (!receiveBlock(&cmd, &rcvBlock) || cmd != BaselineProtocol::Ack)
|
||||||
return false;
|
return false;
|
||||||
ds.device()->seek(0);
|
QDataStream rds(&rcvBlock, QIODevice::ReadOnly);
|
||||||
ds >> *itemList;
|
rds >> *itemList;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ public:
|
|||||||
enum Constant {
|
enum Constant {
|
||||||
ProtocolVersion = 5,
|
ProtocolVersion = 5,
|
||||||
ServerPort = 54129,
|
ServerPort = 54129,
|
||||||
Timeout = 5000
|
Timeout = 15000
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Command {
|
enum Command {
|
||||||
|
@ -254,7 +254,8 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format)
|
|||||||
|
|
||||||
|
|
||||||
if (baseline.status == ImageItem::BaselineNotFound) {
|
if (baseline.status == ImageItem::BaselineNotFound) {
|
||||||
proto.submitNewBaseline(rendered, 0);
|
if (!proto.submitNewBaseline(rendered, 0))
|
||||||
|
QWARN("Failed to submit new baseline: " + proto.errorMessage().toLatin1());
|
||||||
QSKIP("Baseline not found; new baseline created.", SkipSingle);
|
QSKIP("Baseline not found; new baseline created.", SkipSingle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user