summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2017-12-21 10:03:20 +0100
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2017-12-21 09:35:32 +0000
commit3c90c26bb0e54192f35ebc7ccf5f01bf418d4f4a (patch)
tree55557b42b4126050c14e6986d77a912600db769b /tests
parent0d827af5c76edc4157db6761a102a873a8a9e371 (diff)
Fix test failures
When running on low-resource hardware the testserver needs a higher timeout value to properly handle events. Otherwise timeouts might appear, especially in the freeopcua backend. Furthermore, connectToInvalid testcase needs to be adapted as the client might be in Disconnected state already after invoking connectToEndpoint. Change-Id: I142b76abf9394f2777efc18586164accf8ca4074 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qopcuaclient/tst_client.cpp3
-rw-r--r--tests/open62541-testserver/testserver.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/qopcuaclient/tst_client.cpp b/tests/auto/qopcuaclient/tst_client.cpp
index 87666dd..397a95d 100644
--- a/tests/auto/qopcuaclient/tst_client.cpp
+++ b/tests/auto/qopcuaclient/tst_client.cpp
@@ -294,7 +294,8 @@ void Tst_QOpcUaClient::connectToInvalid()
{
QFETCH(QOpcUaClient *, opcuaClient);
opcuaClient->connectToEndpoint(QUrl("opc.tcp:127.0.0.1:1234"));
- QVERIFY(opcuaClient->state() == QOpcUaClient::Connecting);
+ // Depending on the event loop the client might have switched to Disconnected already
+ QVERIFY(opcuaClient->state() == QOpcUaClient::Connecting || opcuaClient->state() == QOpcUaClient::Disconnected);
for (int i = 0; i < 10; ++i) {
QTest::qWait(50);
diff --git a/tests/open62541-testserver/testserver.cpp b/tests/open62541-testserver/testserver.cpp
index c4f6f4c..4ae5708 100644
--- a/tests/open62541-testserver/testserver.cpp
+++ b/tests/open62541-testserver/testserver.cpp
@@ -52,7 +52,7 @@ Q_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_OPEN62541, "qt.opcua.testserver")
TestServer::TestServer(QObject *parent) : QObject(parent)
{
- m_timer.setInterval(0);
+ m_timer.setInterval(30);
m_timer.setSingleShot(false);
connect(&m_timer, &QTimer::timeout, this, &TestServer::processServerEvents);
}