aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-01-31 09:47:00 +0000
committerJustus Winter <[email protected]>2017-01-31 09:47:00 +0000
commitba594d85e35e63301755977234d3af88a167a215 (patch)
tree8651445c8564f4f342cace97f9fe98469e90f5b2
parentcore: Add new context flag "redraw". (diff)
downloadgpgme-ba594d85e35e63301755977234d3af88a167a215.tar.gz
gpgme-ba594d85e35e63301755977234d3af88a167a215.zip
qt: Increase timeout when waiting for signals.
* lang/qt/tests/t-support.h (QSIGNALSPY_TIMEOUT): New macro. * lang/qt/tests/t-encrypt.cpp: Use the new macro as timeout when waiting for signals. * lang/qt/tests/t-keylist.cpp: Likewise. * lang/qt/tests/t-keylocate.cpp: Likewise. * lang/qt/tests/t-ownertrust.cpp: Likewise. * lang/qt/tests/t-wkspublish.cpp: Likewise. -- Increase the timeout when waiting for signals from 5 seconds to 60. This addresses intermittent test failures on slow machines. Signed-off-by: Justus Winter <[email protected]>
-rw-r--r--lang/qt/tests/t-encrypt.cpp2
-rw-r--r--lang/qt/tests/t-keylist.cpp2
-rw-r--r--lang/qt/tests/t-keylocate.cpp4
-rw-r--r--lang/qt/tests/t-ownertrust.cpp4
-rw-r--r--lang/qt/tests/t-support.h4
-rw-r--r--lang/qt/tests/t-wkspublish.cpp14
6 files changed, 17 insertions, 13 deletions
diff --git a/lang/qt/tests/t-encrypt.cpp b/lang/qt/tests/t-encrypt.cpp
index 57b586d5..ba4a1c57 100644
--- a/lang/qt/tests/t-encrypt.cpp
+++ b/lang/qt/tests/t-encrypt.cpp
@@ -165,7 +165,7 @@ private Q_SLOTS:
job->start(keys, inptr, outptr, Context::AlwaysTrust);
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
void testSymmetricEncryptDecrypt()
diff --git a/lang/qt/tests/t-keylist.cpp b/lang/qt/tests/t-keylist.cpp
index 5e88a5ea..a1402368 100644
--- a/lang/qt/tests/t-keylist.cpp
+++ b/lang/qt/tests/t-keylist.cpp
@@ -102,7 +102,7 @@ private Q_SLOTS:
});
job->start(QStringList() << "[email protected]");
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
};
diff --git a/lang/qt/tests/t-keylocate.cpp b/lang/qt/tests/t-keylocate.cpp
index 550305c9..8c99c8bd 100644
--- a/lang/qt/tests/t-keylocate.cpp
+++ b/lang/qt/tests/t-keylocate.cpp
@@ -88,7 +88,7 @@ private Q_SLOTS:
});
job->start(QStringList() << mTestpattern);
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
qputenv("GNUPGHOME", oldHome.toUtf8());
}
#endif
@@ -122,7 +122,7 @@ private Q_SLOTS:
});
job->start(QStringList() << mTestpattern);
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
private:
diff --git a/lang/qt/tests/t-ownertrust.cpp b/lang/qt/tests/t-ownertrust.cpp
index f2fa3c8e..e9a43787 100644
--- a/lang/qt/tests/t-ownertrust.cpp
+++ b/lang/qt/tests/t-ownertrust.cpp
@@ -78,7 +78,7 @@ private Q_SLOTS:
});
job2->start(key, Key::Ultimate);
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
job = openpgp()->keyListJob(false, true, true);
result = job->exec(QStringList() << QStringLiteral("[email protected]"),
@@ -94,7 +94,7 @@ private Q_SLOTS:
Q_EMIT asyncDone();
});
job3->start(key, Key::Unknown);
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
job = openpgp()->keyListJob(false, true, true);
result = job->exec(QStringList() << QStringLiteral("[email protected]"),
diff --git a/lang/qt/tests/t-support.h b/lang/qt/tests/t-support.h
index e3f0e781..b03b05dc 100644
--- a/lang/qt/tests/t-support.h
+++ b/lang/qt/tests/t-support.h
@@ -64,4 +64,8 @@ public Q_SLOTS:
void cleanupTestCase();
};
+/* Timeout, in milliseconds, for use with QSignalSpy to wait on
+ signals. */
+#define QSIGNALSPY_TIMEOUT 60000
+
#endif // T_SUPPORT_H
diff --git a/lang/qt/tests/t-wkspublish.cpp b/lang/qt/tests/t-wkspublish.cpp
index 64f101ee..c51e8f9a 100644
--- a/lang/qt/tests/t-wkspublish.cpp
+++ b/lang/qt/tests/t-wkspublish.cpp
@@ -132,7 +132,7 @@ private Q_SLOTS:
});
job->startCheck ("testuser1@localhost");
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
#ifdef DO_ONLINE_TESTS
private Q_SLOTS:
@@ -155,7 +155,7 @@ private:
});
job->startCheck ("[email protected]");
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
void testWKSPublishErrors() {
@@ -172,7 +172,7 @@ private:
job->startCreate("AB874F24E98EBB8487EE7B170F8E3D97FE7011B7",
QStringLiteral("[email protected]"));
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
void testWKSPublishCreate() {
@@ -206,7 +206,7 @@ private:
});
keygenjob->start(args);
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
/* Then try to create a request. */
auto job = openpgp()->wksPublishJob();
@@ -223,7 +223,7 @@ private:
QStringLiteral("From: " TEST_ADDRESS)));
});
job->startCreate(fpr.constData(), QLatin1String(TEST_ADDRESS));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
void testWKSPublishReceive() {
@@ -242,7 +242,7 @@ private:
});
importjob->start(QByteArray(testSecKey));
QSignalSpy spy (this, SIGNAL(asyncDone()));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
/* Get a response. */
auto job = openpgp()->wksPublishJob();
@@ -259,7 +259,7 @@ private:
QStringLiteral("From: " TEST_ADDRESS)));
});
job->startReceive(QByteArray(testResponse));
- QVERIFY(spy.wait());
+ QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT));
}
void initTestCase()