tst_QTextStream::stillOpenWhenAtEnd(): use QTRY_VERIFY()

The test is flaky every now and then on the CI, so increase the timeout from
5s to 20s (a previous TRY_VERIFY precheck reported just shy of 10s waiting
time, doubling should be™ sufficient).

Amends the start of the public history.

Pick-to: 6.8 6.5 6.2 5.15
Change-Id: I8e64bf8ac1576c0ac71790a03936635016b3b2b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 40e65f029341a01e16dc88871eb7b24979aea9bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2025-02-06 11:51:15 +01:00 committed by Qt Cherry-pick Bot
parent 56c39a2622
commit 267acbc534

View File

@ -1203,7 +1203,7 @@ void tst_QTextStream::stillOpenWhenAtEnd()
QTcpSocket socket; QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::imapServerName(), 143); socket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket.waitForReadyRead(5000)); QTRY_VERIFY_WITH_TIMEOUT(socket.bytesAvailable() > 0, 20000);
QTextStream stream2(&socket); QTextStream stream2(&socket);
while (!stream2.readLine().isNull()) {} while (!stream2.readLine().isNull()) {}