From f85c625799fe8fe8ae2c19907ebd744230edccd1 Mon Sep 17 00:00:00 2001 From: iequidoo <117991069+iequidoo@users.noreply.github.com> Date: Tue, 10 Mar 2026 10:00:54 -0300 Subject: [PATCH] test: Work around test_sync_broadcast_and_send_message flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test sometimes fails because of wrong message ordering for bob: [...] Waiting for the device of alice@example.org to reply… [NOTICED][INFO] Msg#2010πŸ”’: (Contact#Contact#2001): hi [FRESH] Msg#2011πŸ”’: (Contact#Contact#2001): Member Me removed by alice@example.org. [FRESH][INFO] This adds `SystemTime::shift(Duration::from_secs(1))` as a workaround. Co-authored-by: Hocuri --- src/chat/chat_tests.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index 7da7e7c76..4980794fd 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -4701,6 +4701,9 @@ async fn test_sync_broadcast_and_send_message() -> Result<()> { vec![a2b_contact_id] ); + // alice2's smeared clock may be behind alice's one, so "hi" from alice2 may appear before "You + // joined the channel." for bob. + SystemTime::shift(Duration::from_secs(1)); tcm.section("Alice's second device sends a message to the channel"); let sent_msg = alice2.send_text(a2_broadcast_id, "hi").await; let msg = bob.recv_msg(&sent_msg).await;