diff --git a/seastar/src/timer.rs b/seastar/src/timer.rs index 9032fee6..8e29a2b0 100644 --- a/seastar/src/timer.rs +++ b/seastar/src/timer.rs @@ -524,6 +524,24 @@ mod tests { assert!(*calls.borrow() == 2); } + #[seastar::test] + async fn []() { + let mut timer = <$Timer>::new(); + + let calls = Rc::new(RefCell::new(0)); + let calls_cloned = calls.clone(); + let callback = move || { + *calls_cloned.borrow_mut() += 1; + }; + let sg = SchedulingGroup::create("sg", 100.).await; + timer.set_callback_under_group(callback, &sg); + + let duration = <$Duration>::from_millis(100); + timer.arm(duration); + + [](&mut timer, duration, calls).await; + } + #[seastar::test] async fn []() { let (mut timer, duration, calls) = []();