This repository was archived by the owner on Mar 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
tests/auto/datasync/IntegrationTest Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -236,16 +236,22 @@ void IntegrationTest::testAddAccount()
236236 QCOMPARE (grantSpy.takeFirst ()[0 ].toUuid (), dev2Id);
237237
238238 // wait for sync
239- sync1->runOnSynchronized ([this ](SyncManager::SyncState s) {
240- emit unlock ();
241- QCOMPARE (s, SyncManager::Synchronized);
242- }, true );
243- unlockSpy.wait ();
244- sync2->runOnSynchronized ([this ](SyncManager::SyncState s) {
245- emit unlock ();
246- QCOMPARE (s, SyncManager::Synchronized);
247- });
248- unlockSpy.wait ();
239+ qint64 oldCnt1 = 0 ;
240+ qint64 oldCnt2 = 0 ;
241+ do {
242+ oldCnt1 = store1->count ();
243+ oldCnt2 = store2->count ();
244+ sync1->runOnSynchronized ([this ](SyncManager::SyncState s) {
245+ emit unlock ();
246+ QCOMPARE (s, SyncManager::Synchronized);
247+ }, true );
248+ unlockSpy.wait ();
249+ sync2->runOnSynchronized ([this ](SyncManager::SyncState s) {
250+ emit unlock ();
251+ QCOMPARE (s, SyncManager::Synchronized);
252+ });
253+ unlockSpy.wait ();
254+ } while (oldCnt1 != store1->count () || oldCnt2 != store2->count ());
249255
250256 QCOMPARE (store1->count (), 20 );
251257 QCOMPAREUNORDERED (store1->keys (), TestLib::generateDataKeys (0 , 19 ));
You can’t perform that action at this time.
0 commit comments