summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 855b1f9041..e995b69f60 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -5773,6 +5773,15 @@ void tst_QNetworkReply::proxyChange()
QNetworkRequest req(QUrl("http://" + QtNetworkSettings::serverName()));
proxyServer.doClose = false;
+ {
+ // Needed to initialize a network session in QNAM. Without an initialized session the GET
+ // will be deferred until later, and the proxy will be unset first. This caused the test to
+ // fail in standalone runs (it passed in CI because the same QNAM instance is used for the
+ // entire test).
+ QNetworkReplyPtr temporary(manager.get(req));
+ waitForFinish(temporary);
+ }
+
manager.setProxy(dummyProxy);
QNetworkReplyPtr reply1(manager.get(req));
connect(reply1, SIGNAL(finished()), &helper, SLOT(finishedSlot()));