From 801c8a103509b0ae05d655234cda96473e008e1c Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Sun, 15 Nov 2026 12:34:12 -0700 Subject: [PATCH] tests: the background backlog fixture stays oldest-first across wall-clock steps --- crates/rns-interface/src/background_announce.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/rns-interface/src/background_announce.rs b/crates/rns-interface/src/background_announce.rs index 6c64f13..536a05a 100644 --- a/crates/rns-interface/src/background_announce.rs +++ b/crates/rns-interface/src/background_announce.rs @@ -78,6 +78,8 @@ pub(crate) fn scheduled_actor_with_backlog( tx, ); let identity = rns_identity::identity::Identity::new(); + // One clock read: a stepped wall clock must not reorder the oldest-first backlog. + let oldest = rns_transport::now_f64() - count as f64 * 1e-3; let mut first = Bytes::new(); for index in 0..count { let app = format!("test.background.{index}"); @@ -108,7 +110,7 @@ pub(crate) fn scheduled_actor_with_backlog( } entry.announce_queue.push(QueuedAnnounce { destination_hash: dest, - time: rns_transport::now_f64(), + time: oldest + index as f64 * 1e-3, hops: 1, raw, });