From 4efd0d1ef7a7fd1573d903e055c6fd40305528a9 Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 15 Oct 2024 18:59:51 +0000 Subject: [PATCH] test: always gossip if gossip_period is set to 0 This fixes flakiness of `test_verified_group_vs_delete_server_after`. --- src/mimefactory.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mimefactory.rs b/src/mimefactory.rs index df14e5bc2..dcb75da78 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -352,7 +352,11 @@ impl MimeFactory { // beside key- and member-changes, force a periodic re-gossip. let gossiped_timestamp = chat.id.get_gossiped_timestamp(context).await?; let gossip_period = context.get_config_i64(Config::GossipPeriod).await?; - if time() >= gossiped_timestamp + gossip_period { + // `gossip_period == 0` is a special case for testing, + // enabling gossip in every message. + // Othewise "smeared timestamps" may result in the condition + // to fail even if the clock is monotonic. + if gossip_period == 0 || time() >= gossiped_timestamp + gossip_period { Ok(true) } else { Ok(false)