From c231523ef22d355c4d5d804f1f04e53e5ee1506c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Simon=20Fauteux-Chapleau?= Date: Mon, 24 Mar 2025 16:51:05 -0400 Subject: [PATCH] unitTest: fix broken conversation tests Commit 86d3bb6 accidentally broke two conversation tests by removing necessary waiting periods. GitLab: #1117 Change-Id: Idebd037b2bf9083f59a108455fea82f2203a3ece --- test/unitTest/conversation/conversation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unitTest/conversation/conversation.cpp b/test/unitTest/conversation/conversation.cpp index 5b0883649..94db88dad 100644 --- a/test/unitTest/conversation/conversation.cpp +++ b/test/unitTest/conversation/conversation.cpp @@ -2230,6 +2230,10 @@ ConversationTest::testFixContactDetails() aliceAccount->convModule()->loadConversations(); + // loadConversations doesn't fix the contact details synchronously, so the + // test will fail if we don't wait for a little bit here. + std::this_thread::sleep_for(1s); + details = aliceAccount->getContactDetails(bobUri); CPPUNIT_ASSERT(details["conversationId"] == aliceData.conversationId); } @@ -2410,6 +2414,9 @@ ConversationTest::testLoadPartiallyRemovedConversation() // Reloading conversation should remove directory CPPUNIT_ASSERT(std::filesystem::is_directory(repoPathAlice)); aliceAccount->convModule()->loadConversations(); + // loadConversations doesn't remove the directory synchronously, so the + // test will fail if we don't wait for a little bit here. + std::this_thread::sleep_for(1s); CPPUNIT_ASSERT(!std::filesystem::is_directory(repoPathAlice)); }