Skip to content

Commit d04668a

Browse files
committed
agent: fix a flakey test case
1 parent fb1360a commit d04668a

File tree

1 file changed

+3
-5
lines changed
  • crates/agent/src/controllers

1 file changed

+3
-5
lines changed

crates/agent/src/controllers/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,11 @@ mod test {
407407
assert_eq!(0, next.after_seconds);
408408
assert!(next.with_jitter_percent(0).compute_duration().is_zero());
409409

410-
let now = Utc::now();
411-
let then = now + chrono::Duration::seconds(60);
412-
let millis = NextRun::after(then)
410+
let millis = NextRun::after_minutes(1)
413411
.with_jitter_percent(20)
414412
.compute_duration()
415413
.as_millis();
416-
assert!(millis > 59900, "duration too small, got: {millis}ms");
417-
assert!(millis < 72000, "duration too big, got: {millis}ms");
414+
assert!(millis >= 60000, "duration too small, got: {millis}ms");
415+
assert!(millis <= 72000, "duration too big, got: {millis}ms");
418416
}
419417
}

0 commit comments

Comments
 (0)