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.

Pick-to: 6.7
Change-Id: Ifa4982f1b10128674081136a30bdab4b0ce7004a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
bb10
Mårten Nordheim 2024-03-13 14:30:15 +01:00
parent e102edfbf8
commit 5e102a792c
1 changed files with 1 additions and 0 deletions

View File

@ -9948,6 +9948,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;