test: update mock timestamp simulation in test support
This commit is contained in:
1 parent
3de92749e9
commit
2052417b6b
1 file changed
+9
-9
@@ -102,12 +102,12 @@ pub fn config_for_params(addr: SocketAddr, params: &Params) -> ClientConfig {
|
|||||||
|
|
||||||
pub fn standard_timestamps() -> TimestampFields {
|
pub fn standard_timestamps() -> TimestampFields {
|
||||||
TimestampFields {
|
TimestampFields {
|
||||||
recv_wall: Some(1),
|
recv_wall: Some(0),
|
||||||
recv_mono: Some(5_000_000),
|
recv_mono: Some(5_000_000),
|
||||||
midpoint_wall: Some(1),
|
midpoint_wall: Some(0),
|
||||||
midpoint_mono: Some(5_000_000),
|
midpoint_mono: Some(5_000_000),
|
||||||
send_wall: Some(1),
|
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)
|
.duration_since(SystemTime::UNIX_EPOCH)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_nanos() as i64;
|
.as_nanos() as i64;
|
||||||
if timestamps.recv_wall.is_some() {
|
if let Some(offset) = timestamps.recv_wall {
|
||||||
timestamps.recv_wall = Some(now_ns);
|
timestamps.recv_wall = Some(now_ns + offset);
|
||||||
}
|
}
|
||||||
if timestamps.midpoint_wall.is_some() {
|
if let Some(offset) = timestamps.midpoint_wall {
|
||||||
timestamps.midpoint_wall = Some(now_ns);
|
timestamps.midpoint_wall = Some(now_ns + offset);
|
||||||
}
|
}
|
||||||
if timestamps.send_wall.is_some() {
|
if let Some(offset) = timestamps.send_wall {
|
||||||
timestamps.send_wall = Some(now_ns);
|
timestamps.send_wall = Some(now_ns + offset);
|
||||||
}
|
}
|
||||||
timestamps
|
timestamps
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user