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 <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
Shane Kearns 2011-12-08 13:49:36 +00:00 committed by Qt by Nokia
parent e8efad1b22
commit 002cb5d2c8
2 changed files with 1 additions and 2 deletions

View File

@ -24,5 +24,3 @@ win32 {
} else {
DESTDIR = ../
}
CONFIG+=insignificant_test # unstable, QTBUG-21043

View File

@ -1272,6 +1272,7 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
} else {
socket->disconnectFromHost();
QVERIFY(socket->openMode() == QIODevice::ReadWrite);
QVERIFY(socket->waitForDisconnected(5000));
}
// let anything queued happen