From: Shane Kearns Date: Thu, 8 Dec 2011 13:49:36 +0000 (+0000) Subject: Fix unstable test case X-Git-Tag: qt-v5.0.0-alpha1~2338 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=002cb5d2c884793da85b8389a8283f3036438119;p=profile%2Fivi%2Fqtbase.git Fix unstable test case tst_QTcpSocket::disconnectWhileLookingUp required the host lookup + connect + disconnect procedure to complete in <50ms, which is not always true. When disconnecting (rather than aborting with close()), wait for the disconnection to complete with a timeout of 5 seconds. Task-number: QTBUG-21043 Change-Id: I3b59abf9a8eb2c6d99416e1a8ec6b528885b656e Reviewed-by: Robin Burchell Reviewed-by: Bradley T. Hughes --- diff --git a/tests/auto/network/socket/qtcpsocket/test/test.pro b/tests/auto/network/socket/qtcpsocket/test/test.pro index 13c3947..897a875 100644 --- a/tests/auto/network/socket/qtcpsocket/test/test.pro +++ b/tests/auto/network/socket/qtcpsocket/test/test.pro @@ -24,5 +24,3 @@ win32 { } else { DESTDIR = ../ } - -CONFIG+=insignificant_test # unstable, QTBUG-21043 diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index b50a427..09bf8c9 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -1272,6 +1272,7 @@ void tst_QTcpSocket::disconnectWhileLookingUp() } else { socket->disconnectFromHost(); QVERIFY(socket->openMode() == QIODevice::ReadWrite); + QVERIFY(socket->waitForDisconnected(5000)); } // let anything queued happen