From be5e7924ec7bd6cccd626f931f55e2687910ad13 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 25 Mar 2011 13:33:54 +0000 Subject: 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 --- tests/auto/qeventloop/tst_qeventloop.cpp | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v0.12