MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / eval

Function eval

nodedb/src/fail_point.rs:66–73  ·  view source on GitHub ↗

Evaluate the installed action for a fail point. Used by the `fail_point!` macro; not intended to be called directly.

(name: &str)

Source from the content-addressed store, hash-verified

64 /// Evaluate the installed action for a fail point. Used by the
65 /// `fail_point!` macro; not intended to be called directly.
66 pub fn eval(name: &str) {
67 if let Some(action) = lookup(name) {
68 match action {
69 FailAction::Panic => panic!("fail_point fired: {name}"),
70 FailAction::Sleep(d) => std::thread::sleep(d),
71 }
72 }
73 }
74
75 /// RAII guard that clears a fail point on drop. Use to keep tests
76 /// from leaking installed actions across cases.

Callers 2

unset_fail_point_is_noopFunction · 0.70
set_panic_firesFunction · 0.70

Calls 1

lookupFunction · 0.85

Tested by 1

unset_fail_point_is_noopFunction · 0.56