]> cloud.milkyroute.net Git - dolphin.git/commitdiff
[PlacesItemModelTest] Try to double test timeout
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 13 Oct 2018 09:15:09 +0000 (11:15 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 13 Oct 2018 09:18:46 +0000 (11:18 +0200)
The randomly failing `testRefresh()` on the CI can be reproduced by
replacing the QTRY_COMPARE with a simple QCOMPARE.

So it seems the CI can be slow such that the default QTR_COMPARE
timeout of 5 seconds is not enough.

If a timeout of 10 seconds fixes this particular test case, we can use
this bigger timeout also in the other failing tests.

src/tests/placesitemmodeltest.cpp

index 40ee47cbc9beb514eb71a0cb327cc67e3da6feed..c05ce6882754121ec110b048ebfe8109974a22a2 100644 (file)
@@ -43,6 +43,11 @@ Q_DECLARE_METATYPE(KItemRange)
 #define KDE_ROOT_PATH "/"
 #endif
 
+namespace
+{
+    constexpr int TIMEOUT = 10000;
+}
+
 static QString bookmarksFile()
 {
     return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel";
@@ -738,7 +743,7 @@ void PlacesItemModelTest::testRefresh()
     m_model->refresh();
 
     // item must be equal
-    QTRY_COMPARE(item->text(), sameItem->text());
+    QTRY_COMPARE_WITH_TIMEOUT(item->text(), sameItem->text(), TIMEOUT);
 }
 
 void PlacesItemModelTest::testIcons_data()