tst_socketnotifier: Fix timeout of QTcpServer::waitForNewConnection()

The timeout defaults to 0, give it 5s.

Change-Id: I975810a1ecee8bb8b3a3f143f1379a9a09589a40
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
(cherry picked from commit ad84332f2bbe10601ba4c21fd6d4a446d16ed94c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Friedemann Kleint 2021-01-20 07:51:11 +01:00 committed by Qt Cherry-pick Bot
parent f83f4badce
commit f2eb4b14af

View File

@ -147,7 +147,7 @@ void tst_QSocketNotifier::unexpectedDisconnection()
readEnd1.connectToHost(server.serverAddress(), server.serverPort());
QVERIFY(readEnd1.waitForWrite());
QCOMPARE(readEnd1.state(), QAbstractSocket::ConnectedState);
QVERIFY(server.waitForNewConnection());
QVERIFY(server.waitForNewConnection(5000));
QTcpSocket *writeEnd1 = server.nextPendingConnection();
QVERIFY(writeEnd1 != 0);
@ -156,7 +156,7 @@ void tst_QSocketNotifier::unexpectedDisconnection()
readEnd2.connectToHost(server.serverAddress(), server.serverPort());
QVERIFY(readEnd2.waitForWrite());
QCOMPARE(readEnd2.state(), QAbstractSocket::ConnectedState);
QVERIFY(server.waitForNewConnection());
QVERIFY(server.waitForNewConnection(5000));
QTcpSocket *writeEnd2 = server.nextPendingConnection();
QVERIFY(writeEnd2 != 0);