diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index 99c4e17d9..ee8270762 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -1625,6 +1625,7 @@ async fn test_set_chat_name() { "another name", "something different", ] { + SystemTime::shift(Duration::from_secs(1)); set_chat_name(alice, chat_id, new_name).await.unwrap(); let sent_msg = alice.pop_sent_msg().await; let received_msg = bob.recv_msg(&sent_msg).await; @@ -3437,6 +3438,7 @@ async fn test_chat_description( "", "Γ€ ẟ πŸ˜‚", ] { + SystemTime::shift(Duration::from_secs(1)); tcm.section(&format!( "Alice sets the chat description to {description:?}" )); @@ -4459,7 +4461,9 @@ async fn test_get_chat_media_webxdc_order() -> Result<()> { assert_eq!(media.first().unwrap(), &instance1_id); assert_eq!(media.get(1).unwrap(), &instance2_id); - // add a status update for the oder instance; that resorts the list + SystemTime::shift(Duration::from_secs(1)); + + // add a status update for the other instance; that resorts the list alice .send_webxdc_status_update(instance1_id, r#"{"payload": {"foo": "bar"}}"#) .await?; @@ -4873,10 +4877,6 @@ async fn test_sync_broadcast_and_send_message() -> Result<()> { vec![a2b_contact_id] ); - // alice2's smeared clock may be behind alice1's one, so we need to work around "hi" appearing - // before "You joined the channel." for bob. alice1 makes 3 more calls of - // create_smeared_timestamp() than alice2 does as of 2026-03-10. - SystemTime::shift(Duration::from_secs(3)); 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; diff --git a/src/receive_imf/receive_imf_tests.rs b/src/receive_imf/receive_imf_tests.rs index f36295717..7ab4dd8ef 100644 --- a/src/receive_imf/receive_imf_tests.rs +++ b/src/receive_imf/receive_imf_tests.rs @@ -3975,6 +3975,8 @@ async fn test_delayed_removal_is_ignored() -> Result<()> { remove_contact_from_chat(bob, bob_chat_id, bob_contact_fiona).await?; let remove_msg = bob.pop_sent_msg().await; + SystemTime::shift(Duration::from_secs(1)); + // Bob adds new members Dom and Elena, but first addition message is lost. let dom = &tcm.dom().await; let elena = &tcm.elena().await; @@ -3991,6 +3993,8 @@ async fn test_delayed_removal_is_ignored() -> Result<()> { alice.recv_msg(&add_msg).await; assert_eq!(get_chat_contacts(alice, chat_id).await?.len(), 4); + SystemTime::shift(Duration::from_secs(1)); + // Alice re-adds Fiona. add_contact_to_chat(alice, chat_id, alice_fiona).await?; assert_eq!(get_chat_contacts(alice, chat_id).await?.len(), 5); diff --git a/test-data/golden/test_sync_broadcast_alice1 b/test-data/golden/test_sync_broadcast_alice1 index 82ce056e5..7d450fb71 100644 --- a/test-data/golden/test_sync_broadcast_alice1 +++ b/test-data/golden/test_sync_broadcast_alice1 @@ -1,7 +1,7 @@ OutBroadcast#Chat#1001: Channel [0 member(s)] -------------------------------------------------------------------------------- Msg#1001: info (Contact#Contact#Info): Messages are end-to-end encrypted. [NOTICED][INFO] -Msg#1008πŸ”’: Me (Contact#Contact#Self): hi √ Msg#1006πŸ”’: Me (Contact#Contact#Self): Member bob@example.net added. [INFO] √ +Msg#1008πŸ”’: Me (Contact#Contact#Self): hi √ Msg#1009πŸ”’: Me (Contact#Contact#Self): You removed member bob@example.net. [INFO] √ --------------------------------------------------------------------------------