Merge branch 'ahf/563-appveyor-test-fix' into 'main'

Shorten the duration needed in preemptive::test::does_not_predict_old_ports.

See merge request tpo/core/arti!708
This commit is contained in:
Nick Mathewson 2022-08-31 17:00:17 +00:00
commit 6406e4db74
1 changed files with 3 additions and 2 deletions

View File

@ -167,9 +167,10 @@ mod test {
cfg.set_initial_predicted_ports(vec![]);
cfg.prediction_lifetime(Duration::from_secs(2));
let mut predictor = PreemptiveCircuitPredictor::new(cfg.build().unwrap());
let more_than_an_hour_ago = Instant::now() - Duration::from_secs(60 * 60 + 1);
let now = Instant::now();
let three_seconds_ago = now - Duration::from_secs(2 + 1);
predictor.note_usage(Some(TargetPort::ipv4(2345)), more_than_an_hour_ago);
predictor.note_usage(Some(TargetPort::ipv4(2345)), three_seconds_ago);
assert_isoleq!(
predictor.predict(),