File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,24 @@ mod tests {
303303 assert!( * calls. borrow( ) == 2 ) ;
304304 }
305305
306+ #[ seastar:: test]
307+ async fn [ <test_ $timer _set_callback_under_group>] ( ) {
308+ let mut timer = Timer :: <$Clock>:: new( ) ;
309+
310+ let calls = Rc :: new( RefCell :: new( 0 ) ) ;
311+ let calls_cloned = calls. clone( ) ;
312+ let callback = move || {
313+ * calls_cloned. borrow_mut( ) += 1 ;
314+ } ;
315+ let sg = SchedulingGroup :: create( "sg" , 100. ) . await ;
316+ timer. set_callback_under_group( callback, & sg) ;
317+
318+ let duration = Duration :: from_millis( 100 ) ;
319+ timer. arm( duration) ;
320+
321+ [ <check_ $timer>] ( & mut timer, duration, calls) . await ;
322+ }
323+
306324 #[ seastar:: test]
307325 async fn [ <test_ $timer _arm_at>] ( ) {
308326 let ( mut timer, duration, calls) = [ <set_up_ $timer _test>] ( ) ;
You can’t perform that action at this time.
0 commit comments