From e374fcaa967afc06e8763e86f9a309b7a93d7fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 28 Apr 2022 09:22:25 +0200 Subject: [PATCH] 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 (cherry picked from commit b322984b49f5efec7a0eb567091e58a0c6800d93) Reviewed-by: Qt Cherry-pick Bot --- .../network/access/qnetworkreply/tst_qnetworkreply.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 8034f986ad8..5e8ca224ba2 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -9119,8 +9119,12 @@ void tst_QNetworkReply::autoDeleteRepliesAttribute_data() { QTest::addColumn("destination"); - QTest::newRow("http") << QUrl("http://QInvalidDomain.qt/test"); - QTest::newRow("https") << QUrl("https://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; if (ftpSupported) QTest::newRow("ftp") << QUrl("ftp://QInvalidDomain.qt/test"); QTest::newRow("file") << QUrl("file:///thisfolderdoesn'texist/probably.txt");