File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,7 @@ impl FailPoint {
612
612
613
613
fn set_actions ( & self , actions_str : & str , actions : Vec < Action > ) {
614
614
loop {
615
+ #[ cfg( feature = "async" ) ]
615
616
self . async_pause_notify . notify_waiters ( ) ;
616
617
// TODO: maybe busy waiting here.
617
618
match self . actions . try_write ( ) {
@@ -674,7 +675,10 @@ impl FailPoint {
674
675
Task :: Callback ( f) => {
675
676
f. run ( ) ;
676
677
}
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
+ ) ,
678
682
}
679
683
None
680
684
}
@@ -1229,7 +1233,8 @@ mod tests {
1229
1233
assert_eq ! ( f1( ) , 0 ) ;
1230
1234
}
1231
1235
1232
- #[ cfg_attr( not( all( feature = "failpoints" , feature = "async" ) ) , ignore) ]
1236
+ #[ cfg( feature = "async" ) ]
1237
+ #[ cfg_attr( not( feature = "failpoints" ) , ignore) ]
1233
1238
#[ tokio:: test]
1234
1239
async fn test_async_failpoint ( ) {
1235
1240
use std:: time:: Duration ;
You can’t perform that action at this time.
0 commit comments