tst_QNetworkReply: cleanup changed state from timeout test

It was not setting the value _back_ to 0 when the function ended
and this caused qtbug68821proxyError to fail fairly consistently
on Windows when it was running in the same run.

qtbug68821proxyError was always succeeding when ran by itself so
it was quite odd.

Change-Id: Ifa4982f1b10128674081136a30bdab4b0ce7004a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 5e102a792c4ee0db180defe480cb96c197871508)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mårten Nordheim 2024-03-13 14:30:15 +01:00 committed by Qt Cherry-pick Bot
parent 513a5d074c
commit 4b7e8af859

View File

@ -9931,6 +9931,7 @@ void tst_QNetworkReply::requestWithTimeout()
// Manager instance remains between case runs => always reset it's transferTimeout to
// ensure setting its transferTimeout in this case has effect
manager.setTransferTimeout(0ms);
auto cleanup = qScopeGuard([this] { manager.setTransferTimeout(0ms); });
MiniHttpServer server(tst_QNetworkReply::httpEmpty200Response, false);
server.stopTransfer = true;