summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2022-04-28 09:22:25 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2022-05-10 21:29:28 +0000
commit0a8b2340c41edd4909b1987988f1d835c7f494fb (patch)
treef0207e8e9fd2a6563b05897cd0ee55e499901fb4 /tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
parenta8008297568f824e0e1a66cc5a33ad8ef6b1752d (diff)
tst_QNetworkReply try stabilize autoDeleteReplies tests
The http test data hasn't always been stable but for some reason it fails far more than usual. Originally the domain was a non-existing one, because it would then work on any machine (even if not in CI) and would finish() (with error) after failing to look up the domain in DNS. However, some machines in CI, for some reason, take too long to do this and end up failing the test. So, we change the URL to point to the network server in CI. This should, at the very least, finish quickly when running in CI. Fixes: QTBUG-102952 Change-Id: I3b3f6fa23acf78fefdb69ff9ae7722f15e5f1736 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit b322984b49f5efec7a0eb567091e58a0c6800d93) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 3d4a094c43..278139f2bd 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -9279,9 +9279,16 @@ void tst_QNetworkReply::autoDeleteRepliesAttribute_data()
{
QTest::addColumn<QUrl>("destination");
- QTest::newRow("http") << QUrl("http://QInvalidDomain.qt/test");
- QTest::newRow("https") << QUrl("https://QInvalidDomain.qt/test");
- QTest::newRow("ftp") << QUrl("ftp://QInvalidDomain.qt/test");
+ QUrl webServerUrl = QtNetworkSettings::httpServerIp().toString();
+ webServerUrl.setPath("/notfound");
+ webServerUrl.setScheme("http");
+ QTest::newRow("http") << webServerUrl;
+ webServerUrl.setScheme("https");
+ QTest::newRow("https") << webServerUrl;
+ QUrl ftpServerUrl = QtNetworkSettings::ftpServerName();
+ ftpServerUrl.setScheme("ftp");
+ ftpServerUrl.setPath("/test/notfound");
+ QTest::newRow("ftp") << ftpServerUrl;
QTest::newRow("file") << QUrl("file:///thisfolderdoesn'texist/probably.txt");
#ifdef Q_OS_WIN
// Only supported on windows.