File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,7 @@ impl FailPoint {
612612
613613 fn set_actions ( & self , actions_str : & str , actions : Vec < Action > ) {
614614 loop {
615+ #[ cfg( feature = "async" ) ]
615616 self . async_pause_notify . notify_waiters ( ) ;
616617 // TODO: maybe busy waiting here.
617618 match self . actions . try_write ( ) {
@@ -674,7 +675,10 @@ impl FailPoint {
674675 Task :: Callback ( f) => {
675676 f. run ( ) ;
676677 }
677- Task :: CallbackAsync ( _) => unreachable ! ( ) ,
678+ #[ cfg( feature = "async" ) ]
679+ Task :: CallbackAsync ( _) => panic ! (
680+ "to use async callback, please enable `async` feature and use `async_fail_point`"
681+ ) ,
678682 }
679683 None
680684 }
@@ -1229,7 +1233,8 @@ mod tests {
12291233 assert_eq ! ( f1( ) , 0 ) ;
12301234 }
12311235
1232- #[ cfg_attr( not( all( feature = "failpoints" , feature = "async" ) ) , ignore) ]
1236+ #[ cfg( feature = "async" ) ]
1237+ #[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
12331238 #[ tokio:: test]
12341239 async fn test_async_failpoint ( ) {
12351240 use std:: time:: Duration ;
You can’t perform that action at this time.
0 commit comments