Skip to content

Commit

Permalink
Decrease Update Precision to Stabilise Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
waynerobinson committed Feb 15, 2024
1 parent 8e34dca commit a355182
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions governor/src/clock/quanta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mod test {
let one_ns = Nanos::new(1);
// let _c1 =
// QuantaUpkeepClock::from_builder(quanta::Upkeep::new(Duration::from_secs(1))).unwrap();
let c = QuantaUpkeepClock::from_interval(Duration::from_micros(10)).unwrap();
let c = QuantaUpkeepClock::from_interval(Duration::from_millis(50)).unwrap();
let now = c.now();
assert_ne!(now + one_ns, now);
assert_eq!(one_ns, Reference::duration_since(&(now + one_ns), now));
Expand All @@ -152,10 +152,10 @@ mod test {
// Test clock advances over time.
// (included in one test as only one QuantaUpkeepClock thread can be run at a time)
let start = c.now();
for _ in 0..10 {
thread::sleep(Duration::from_micros(100));
for i in 0..5 {

Check failure on line 155 in governor/src/clock/quanta.rs

View workflow job for this annotation

GitHub Actions / ci_rust / rust_lints / cargo fmt .

Diff in /home/runner/work/governor/governor/governor/src/clock/quanta.rs
thread::sleep(Duration::from_millis(250));
let now = c.now();
assert!(now > start, "now={:?} not after start={:?}", now, start);
assert!(now > start, "now={:?} not after start={:?} on iteration={}", now, start, i);
}
}
}

0 comments on commit a355182

Please sign in to comment.