summaryrefslogtreecommitdiffstats
path: root/tests/auto/qeventloop/tst_qeventloop.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-03-25 13:33:54 +0000
committerShane Kearns <shane.kearns@accenture.com>2011-03-25 13:33:54 +0000
commitbe5e7924ec7bd6cccd626f931f55e2687910ad13 (patch)
treeddae2955898b2ca7769121577d8e48bb3758827d /tests/auto/qeventloop/tst_qeventloop.cpp
parent10d81f9a815f889ebf693f89eaf381299d7ccfc2 (diff)
Fix for tst_QEventLoop::processEventsExcludeSocket
Depending on the OS scheduling, the TCP data sent and flushed may not have been looped back to trigger the socket's ready to read notification before the test called processEvents. This caused a failure on CI system windows 7. Added a short delay before processEvents to allow the OS to catch up. Reviewed-By: Markus Goetz
Diffstat (limited to 'tests/auto/qeventloop/tst_qeventloop.cpp')
-rw-r--r--tests/auto/qeventloop/tst_qeventloop.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp
index aad839063d..fa2a34ecb2 100644
--- a/tests/auto/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/qeventloop/tst_qeventloop.cpp
@@ -602,6 +602,7 @@ public slots:
QTcpSocket *serverSocket = server->nextPendingConnection();
serverSocket->write(data, size);
serverSocket->flush();
+ QTest::qSleep(200); //allow the TCP/IP stack time to loopback the data, so our socket is ready to read
QCoreApplication::processEvents(QEventLoop::ExcludeSocketNotifiers);
testResult = dataArrived;
QCoreApplication::processEvents(); //check the deferred event is processed