diff options
Diffstat (limited to 'crates/tor-circmgr/src/path')
| -rw-r--r-- | crates/tor-circmgr/src/path/exitpath.rs | 7 | ||||
| -rw-r--r-- | crates/tor-circmgr/src/path/hspath.rs | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/crates/tor-circmgr/src/path/exitpath.rs b/crates/tor-circmgr/src/path/exitpath.rs index 793496444..63379cf2d 100644 --- a/crates/tor-circmgr/src/path/exitpath.rs +++ b/crates/tor-circmgr/src/path/exitpath.rs @@ -219,6 +219,7 @@ mod test { use tor_persist::TestingStateMgr; use tor_relay_selection::LowLevelRelayPredicate; use tor_rtcompat::SleepProvider; + use web_time_compat::SystemTimeExt; impl<'a> MaybeOwnedRelay<'a> { fn can_share_circuit( @@ -283,7 +284,7 @@ mod test { let guards = tor_guardmgr::GuardMgr::new(rt.clone(), statemgr, &TestConfig::default()).unwrap(); guards.install_test_netdir(&netdir); - let now = SystemTime::now(); + let now = SystemTime::get(); for _ in 0..1000 { let (path, _, _) = ExitPathBuilder::from_target_ports(ports.clone()) @@ -317,7 +318,7 @@ mod test { let guards = tor_guardmgr::GuardMgr::new(rt.clone(), statemgr, &TestConfig::default()).unwrap(); guards.install_test_netdir(&netdir); - let now = SystemTime::now(); + let now = SystemTime::get(); let config = PathConfig::default(); for _ in 0..1000 { @@ -372,7 +373,7 @@ mod test { tor_guardmgr::GuardMgr::new(rt.clone(), statemgr, &TestConfig::default()).unwrap(); guards.install_test_netdir(&netdir); let config = PathConfig::default(); - let now = SystemTime::now(); + let now = SystemTime::get(); // With target ports let outcome = ExitPathBuilder::from_target_ports(vec![TargetPort::ipv4(80)]) diff --git a/crates/tor-circmgr/src/path/hspath.rs b/crates/tor-circmgr/src/path/hspath.rs index 2adba60d9..4c581fdf7 100644 --- a/crates/tor-circmgr/src/path/hspath.rs +++ b/crates/tor-circmgr/src/path/hspath.rs @@ -429,6 +429,7 @@ mod test { use tor_netdoc::doc::netstatus::RelayWeight; use tor_netdoc::types::relay_flags::RelayFlag; use tor_rtmock::MockRuntime; + use web_time_compat::SystemTimeExt; #[cfg(all(feature = "vanguards", feature = "hs-common"))] use { @@ -601,7 +602,8 @@ mod test { let netdir_provider: Arc<dyn NetDirProvider> = netdir_provider; guards.install_netdir_provider(&netdir_provider).unwrap(); let config = PathConfig::default(); - let now = SystemTime::now(); + // TODO #2428. (This is just testing, though) + let now = SystemTime::get(); let dirinfo = (netdir).into(); HsPathBuilder::new(target.cloned(), stem_kind, circ_kind) .pick_path_with_vanguards(&mut rng, dirinfo, &guards, &vanguardmgr, &config, now) @@ -616,7 +618,8 @@ mod test { ) -> Result<TorPath<'a>> { let mut rng = testing_rng(); let config = PathConfig::default(); - let now = SystemTime::now(); + // TODO #2428. (This is just testing, though) + let now = SystemTime::get(); let dirinfo = (netdir).into(); let guards = tor_guardmgr::GuardMgr::new( MockRuntime::new(), |
