diff --git a/tests/testlib/akonadistoragetestbase.h b/tests/testlib/akonadistoragetestbase.h --- a/tests/testlib/akonadistoragetestbase.h +++ b/tests/testlib/akonadistoragetestbase.h @@ -42,6 +42,8 @@ virtual Akonadi::MonitorInterface::Ptr createMonitor() = 0; private slots: + void cleanupTestCase(); + void dumpTree(); void shouldListCollections_data(); void shouldListCollections(); diff --git a/tests/testlib/akonadistoragetestbase.cpp b/tests/testlib/akonadistoragetestbase.cpp --- a/tests/testlib/akonadistoragetestbase.cpp +++ b/tests/testlib/akonadistoragetestbase.cpp @@ -59,6 +59,13 @@ qRegisterMetaType(); } +void AkonadiStorageTestBase::cleanupTestCase() +{ + // Give a chance for jobs still waiting for an event loop + // run to be deleted through deleteLater() + QTest::qWait(10); +} + void AkonadiStorageTestBase::dumpTree() { TestLib::AkonadiDebug::dumpTree(createStorage()); diff --git a/tests/units/migrator/zanshin021migrationtest.cpp b/tests/units/migrator/zanshin021migrationtest.cpp --- a/tests/units/migrator/zanshin021migrationtest.cpp +++ b/tests/units/migrator/zanshin021migrationtest.cpp @@ -67,6 +67,13 @@ //qApp->exec(); } + void cleanupTestCase() + { + // Give a chance for jobs still waiting for an event loop + // run to be deleted through deleteLater() + QTest::qWait(10); + } + void shouldFetchAllItems() { // GIVEN