From df8a18476a7e402694ad669e500b1e10e020dd73 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Thu, 28 Jun 2012 11:11:05 +1000 Subject: Work around test failure for pixmap cache. A deadlock condition can occur in the qtbase network management code. Added a work around for the bug, and marked the test as significant for CI on Ubuntu 10.04 LTS. Task-number: QTBUG-25307 Change-Id: I6c11645d29dfd34b564f0a811c6f3470b8f31312 Reviewed-by: Michael Brasser --- tests/auto/quick/qquickpixmapcache/qquickpixmapcache.pro | 2 -- tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp | 12 ++++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'tests') 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 #include "../../shared/util.h" #include "testhttpserver.h" +#include #ifndef QT_NO_CONCURRENT #include @@ -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()); -- cgit v1.2.3