Skip to content
Permalink
Browse files
quick fix qgis_tiledownloadmanagertest flapping
  • Loading branch information
MorriganR authored and nyalldawson committed Jun 15, 2021
1 parent b1ae357 commit 1324d52cfbb89ea5f3ebb7b9f99e66c75fa8ad2e
Showing with 2 additions and 2 deletions.
  1. +2 −2 tests/src/core/testqgstiledownloadmanager.cpp
@@ -29,7 +29,7 @@

const QString url_1 = "https://www.qwant.com/maps/tiles/ozbasemap/0/0/0.pbf";
const QString url_2 = "https://www.qwant.com/maps/tiles/ozbasemap/1/0/0.pbf";
const QString url_bad = "http://www.example.com/download-manager-fail";
const QString url_bad = "https://www.qwant.com/maps/tiles/ozbasemap/1/0/90913.pbf";


class TestQgsTileDownloadManager : public QObject
@@ -185,12 +185,12 @@ void TestQgsTileDownloadManager::testOneRequestTwiceAndEarlyDelete()
std::unique_ptr<QgsTileDownloadManagerReply> r2( manager.get( QNetworkRequest( url_1 ) ) );

QVERIFY( manager.hasPendingRequests() );
QSignalSpy spy( r2.get(), &QgsTileDownloadManagerReply::finished );

QThread::usleep( 1000 ); // sleep 1ms - enough time to start request but not enough to finish it

r1.reset();

QSignalSpy spy( r2.get(), &QgsTileDownloadManagerReply::finished );
spy.wait();
QCOMPARE( spy.count(), 1 );
QVERIFY( !r2->data().isEmpty() );

0 comments on commit 1324d52

Please sign in to comment.