diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-11 16:50:35 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-10-17 07:16:29 +0000 |
commit | d1cd39081bec05bca446c75af87ef2118563498e (patch) | |
tree | ce743a7a2f6ebb68fb4ed95fc6157bed73df53a6 /src/plugins | |
parent | cafd5ced1ab02d79e3765f059b66c6b3b6533e73 (diff) | |
download | qt-creator-d1cd39081bec05bca446c75af87ef2118563498e.tar.gz |
QmlProfiler: Further improve QmlProfilerTool test
Don't close the fake debug server after receiving one connection. The
client might time out after establishing the TCP connection, but before
receiving the hello message.
Also, retry more aggressively, just like we do in the
QmlProfilerClientManager test.
Change-Id: Ib0a6c068c97d8000b599d51f31f90712db219af2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp index a519f6a775..8f7ecb778e 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp @@ -54,6 +54,13 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), newKitPtr->id().toSetting()); QmlProfilerTool profilerTool; + + QmlProfilerClientManager *clientManager = profilerTool.clientManager(); + clientManager->setRetryInterval(10); + clientManager->setMaximumRetries(10); + connect(clientManager, &QmlProfilerClientManager::connectionFailed, + clientManager, &QmlProfilerClientManager::retryConnect); + QTcpServer server; QUrl serverUrl = Utils::urlFromLocalHostAndFreePort(); QVERIFY(serverUrl.port() >= 0); @@ -64,7 +71,6 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() connect(&server, &QTcpServer::newConnection, this, [&]() { connection.reset(server.nextPendingConnection()); fakeDebugServer(connection.data()); - server.close(); }); QTimer timer; @@ -94,7 +100,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() QTRY_VERIFY(runControl->isRunning()); QTRY_VERIFY(modalSeen); QTRY_VERIFY(!timer.isActive()); - QTRY_VERIFY(profilerTool.clientManager()->isConnected()); + QTRY_VERIFY(clientManager->isConnected()); connection.reset(); QTRY_VERIFY(runControl->isStopped()); |