summaryrefslogtreecommitdiffstats
path: root/tests/auto/qeventloop
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-03-25 13:33:54 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-03-25 13:33:54 (GMT)
commitbe5e7924ec7bd6cccd626f931f55e2687910ad13 (patch)
treeddae2955898b2ca7769121577d8e48bb3758827d /tests/auto/qeventloop
parent10d81f9a815f889ebf693f89eaf381299d7ccfc2 (diff)
downloadQt-be5e7924ec7bd6cccd626f931f55e2687910ad13.zip
Qt-be5e7924ec7bd6cccd626f931f55e2687910ad13.tar.gz
Qt-be5e7924ec7bd6cccd626f931f55e2687910ad13.tar.bz2
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')
-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 aad8390..fa2a34e 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