From 2052417b6bcf260df17bae6ec1f9e4a3a0567e8f Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Sun, 3 May 2026 21:30:19 +0700 Subject: [PATCH] test: update mock timestamp simulation in test support --- crates/irtt-client/tests/support/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/irtt-client/tests/support/mod.rs b/crates/irtt-client/tests/support/mod.rs index e143383..e87349a 100644 --- a/crates/irtt-client/tests/support/mod.rs +++ b/crates/irtt-client/tests/support/mod.rs @@ -102,12 +102,12 @@ pub fn config_for_params(addr: SocketAddr, params: &Params) -> ClientConfig { pub fn standard_timestamps() -> TimestampFields { TimestampFields { - recv_wall: Some(1), + recv_wall: Some(0), recv_mono: Some(5_000_000), - midpoint_wall: Some(1), + midpoint_wall: Some(0), midpoint_mono: Some(5_000_000), send_wall: Some(1), - send_mono: Some(5_000_000), + send_mono: Some(5_000_001), } } @@ -346,14 +346,14 @@ fn materialize_wall_timestamps(mut timestamps: TimestampFields) -> TimestampFiel .duration_since(SystemTime::UNIX_EPOCH) .unwrap() .as_nanos() as i64; - if timestamps.recv_wall.is_some() { - timestamps.recv_wall = Some(now_ns); + if let Some(offset) = timestamps.recv_wall { + timestamps.recv_wall = Some(now_ns + offset); } - if timestamps.midpoint_wall.is_some() { - timestamps.midpoint_wall = Some(now_ns); + if let Some(offset) = timestamps.midpoint_wall { + timestamps.midpoint_wall = Some(now_ns + offset); } - if timestamps.send_wall.is_some() { - timestamps.send_wall = Some(now_ns); + if let Some(offset) = timestamps.send_wall { + timestamps.send_wall = Some(now_ns + offset); } timestamps }