diff options
-rw-r--r-- | tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro b/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro index 03d7eef66a..185eb2c213 100644 --- a/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro +++ b/tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro @@ -14,6 +14,4 @@ TESTDATA = data/* # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage # LIBS += -lgcov -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = lucid ]"):CONFIG += insignificant_test # QTBUG-25307 - QT += core-private gui-private qml-private quick-private network testlib concurrent diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp index 8d2eb66e08..fb2405c27a 100644 --- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp +++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp @@ -46,6 +46,7 @@ #include <QNetworkReply> #include "../../shared/util.h" #include "testhttpserver.h" +#include <QtNetwork/QNetworkConfigurationManager> #ifndef QT_NO_CONCURRENT #include <qtconcurrentrun.h> @@ -110,10 +111,17 @@ static const bool localfile_optimized = true; static const bool localfile_optimized = false; #endif - void tst_qquickpixmapcache::initTestCase() { QQmlDataTest::initTestCase(); + + // This avoids a race condition/deadlock bug in network config + // manager when it is accessed by the HTTP server thread before + // anything else. Bug report can be found at: + // https://bugreports.qt-project.org/browse/QTBUG-26355 + QNetworkConfigurationManager cm; + cm.updateConfigurations(); + server.serveDirectory(testFile("http")); } @@ -274,7 +282,7 @@ void tst_qquickpixmapcache::parallel() if (i == cancel) { QVERIFY(!getters[i]->gotslot); } else { - if (pending[i]) + if (pending[i]) QVERIFY(getters[i]->gotslot); QVERIFY(pixmap->isReady()); |