Skip to content

Commit

Permalink
fix default build
Browse files Browse the repository at this point in the history
Signed-off-by: Xinye <[email protected]>
  • Loading branch information
Xinye committed Oct 25, 2023
1 parent ea06e6c commit d0c09e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ impl FailPoint {

fn set_actions(&self, actions_str: &str, actions: Vec<Action>) {
loop {
#[cfg(feature = "async")]
self.async_pause_notify.notify_waiters();
// TODO: maybe busy waiting here.
match self.actions.try_write() {
Expand Down Expand Up @@ -674,7 +675,10 @@ impl FailPoint {
Task::Callback(f) => {
f.run();
}
Task::CallbackAsync(_) => unreachable!(),
#[cfg(feature = "async")]
Task::CallbackAsync(_) => panic!(
"to use async callback, please enable `async` feature and use `async_fail_point`"
),
}
None
}
Expand Down Expand Up @@ -1229,7 +1233,8 @@ mod tests {
assert_eq!(f1(), 0);
}

#[cfg_attr(not(all(feature = "failpoints", feature = "async")), ignore)]
#[cfg(feature = "async")]
#[cfg_attr(not(feature = "failpoints"), ignore)]
#[tokio::test]
async fn test_async_failpoint() {
use std::time::Duration;
Expand Down

0 comments on commit d0c09e7

Please sign in to comment.