qdeclarativedebugclient: Fix flaky autotest
authorKent Hansen <kent.hansen@nokia.com>
Fri, 25 Nov 2011 22:03:24 +0000 (23:03 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 28 Nov 2011 06:45:43 +0000 (07:45 +0100)
The connectToHost() call can try to establish the connection directly
(synchronously), in which case the warning message will be output
before the subsequent ignoreMessage() call, causing the test to fail.

Change-Id: I08a6a7d4d090cbb942c348e0787b586c71318f99
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp

index 46a711a..343399b 100644 (file)
@@ -148,9 +148,9 @@ void tst_QDeclarativeDebugClient::parallelConnect()
 {
     QDeclarativeDebugConnection connection2;
 
-    connection2.connectToHost("127.0.0.1", PORT);
     QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Another client is already connected");
     // will connect & immediately disconnect
+    connection2.connectToHost("127.0.0.1", PORT);
     QVERIFY(connection2.waitForConnected());
     QTRY_COMPARE(connection2.state(), QAbstractSocket::UnconnectedState);
     QVERIFY(m_conn->isConnected());