summaryrefslogtreecommitdiffstats
path: root/tests/arthur
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2010-09-09 08:46:34 (GMT)
committeraavit <qt-info@nokia.com>2010-09-09 08:46:34 (GMT)
commit3c29f241cebf18f4927579e054e2906915328cac (patch)
treeb6dd1463026184ff86621d3bdfa2f5508947e255 /tests/arthur
parent4d89a1dc2ea1f1dfbb6109d940496e924185fe13 (diff)
downloadQt-3c29f241cebf18f4927579e054e2906915328cac.zip
Qt-3c29f241cebf18f4927579e054e2906915328cac.tar.gz
Qt-3c29f241cebf18f4927579e054e2906915328cac.tar.bz2
Improved server logging and more robust client connection attempt
Also misc minor improvements all around
Diffstat (limited to 'tests/arthur')
-rwxr-xr-xtests/arthur/baselineserver/bin/runserver11
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.cpp7
-rw-r--r--tests/arthur/common/baselineprotocol.cpp17
-rw-r--r--tests/arthur/common/baselineprotocol.h3
4 files changed, 25 insertions, 13 deletions
diff --git a/tests/arthur/baselineserver/bin/runserver b/tests/arthur/baselineserver/bin/runserver
index 52feb86..48c5c1d 100755
--- a/tests/arthur/baselineserver/bin/runserver
+++ b/tests/arthur/baselineserver/bin/runserver
@@ -1,6 +1,13 @@
#!/bin/bash
+logfile=baselineserver.log
+
while true; do
- ./baselineserver
- sleep 5
+ echo >> $logfile
+ echo -n "***RESTARTING*** " >> $logfile
+ date >> $logfile
+
+ ./baselineserver 2>&1 | tee -a $logfile
+
+ sleep 2
done
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp
index 5a96b90..2eee408 100644
--- a/tests/arthur/baselineserver/src/baselineserver.cpp
+++ b/tests/arthur/baselineserver/src/baselineserver.cpp
@@ -128,7 +128,8 @@ void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock)
ImageItemList itemList;
QDataStream ds(itemListBlock);
ds >> itemList;
- qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count() << "items";
+ qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count() << "items, engine"
+ << itemList.at(0).engineAsString() << "pixel format" << itemList.at(0).formatAsString();
for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) {
if (i->scriptName.startsWith(QLatin1String("porter_duff"))) {
@@ -182,7 +183,7 @@ void BaselineHandler::storeImage(const QByteArray &itemBlock, bool isBaseline)
msg += " image stored in "
+ QHostInfo::localHostName().toLatin1() + '.'
+ QHostInfo::localDomainName().toLatin1() + ':'
- + QFileInfo(file).absoluteFilePath().toLatin1();
+ + prefix.toLatin1() + FileFormat;
proto.sendBlock(BaselineProtocol::Ack, msg);
}
@@ -209,7 +210,7 @@ QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline)
if (isBaseline)
storePath += QString(QLatin1String("baselines_%1_%2/")).arg(item.engineAsString(), item.formatAsString());
else
- storePath += runId + QLatin1Char('/');
+ storePath += QString(QLatin1String("mismatches_%1_%2/")).arg(item.engineAsString(), item.formatAsString()) + runId + QLatin1Char('/');
QString itemName = item.scriptName;
if (itemName.contains(QLatin1Char('.')))
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp
index 34d1a04..01ae67a 100644
--- a/tests/arthur/common/baselineprotocol.cpp
+++ b/tests/arthur/common/baselineprotocol.cpp
@@ -3,6 +3,7 @@
#include <QImage>
#include <QBuffer>
#include <QHostInfo>
+#include <QTest>
PlatformInfo::PlatformInfo(bool useLocal)
{
@@ -145,11 +146,17 @@ bool BaselineProtocol::connect()
if (serverName.isNull())
serverName = "chimera.europe.nokia.com";
- socket.connectToHost(serverName, ServerPort);
-
- if (!socket.waitForConnected(Timeout)) {
- errMsg += QLatin1String("TCP connectToHost failed. Host:") + serverName + QLatin1String(" port:") + QString::number(ServerPort);
- return false;
+ for (int i = 0; i < 2; i++) {
+ socket.connectToHost(serverName, ServerPort);
+ if (!socket.waitForConnected(Timeout)) {
+ if (!i && socket.error() == QAbstractSocket::ConnectionRefusedError) {
+ QTest::qSleep(3000); // In case the server is just restarting, we try again
+ continue;
+ }
+ errMsg += QLatin1String("TCP connectToHost failed. Host:") + serverName + QLatin1String(" port:") + QString::number(ServerPort);
+ return false;
+ }
+ break;
}
PlatformInfo pi(true);
diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h
index 5427023..062a99c 100644
--- a/tests/arthur/common/baselineprotocol.h
+++ b/tests/arthur/common/baselineprotocol.h
@@ -111,7 +111,4 @@ private:
};
-
-
-
#endif // BASELINEPROTOCOL_H