Skip to content

Commit 0d5c7db

Browse files
committed
tests: timer: Reuse the test timer to wait a bit more
By reusing the test, we test the path of 'stop' and starting a new timer. This also gives some time for there to possibly be any stray callbacks happening. Signed-off-by: David Brown <[email protected]>
1 parent 4c6002b commit 0d5c7db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/timer/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ fn timer_test() {
7474
printkln!("Atomics fired {} times", atomic_count);
7575

7676
printkln!("Period ticks: {}", count);
77+
78+
// Now that everything is done and cleaned up, allow a little time to pass to make sure there
79+
// are no stray timers. We can re-use the total test timer.
80+
let mut total_test = total_test.stop().start_simple(Duration::millis_at_least(1), NoWait);
81+
total_test.read_count_wait();
7782
}
7883

7984
/// Test a SimpleTimer.

0 commit comments

Comments
 (0)