Configure the actions for a fail point at runtime.
Each fail point can be configured with a series of actions, specified by the
actions argument. The format of
multiple actions are specified, an action will be checked only when its
former action is not triggered.
The format of a single action is
p% is the
expected probability that the action is triggered, and
cnt* is the max
times the action can be triggered. The supported values of
off, the fail point will do nothing.
return(arg), return early when the fail point is triggered.
argis passed to
$e( defined via the
fail_point!macro) as a string.
sleep(milliseconds), sleep for the specified time.
panic(msg), panic with the message.
print(msg), log the message, using the
logcrate, at the
pause, sleep until other action is set to the fail point.
yield, yield the CPU.
delay(milliseconds), busy waiting for the specified time.
20%3*print(still alive!)->panic means the fail point has 20% chance to print a
message "still alive!" and 80% chance to panic. And the message will be printed at most 3
FAILPOINTS environment variable accepts this same syntax for its fail
A call to
cfg with a particular fail point name overwrites any existing actions for
that fail point, including those set via the
FAILPOINTS environment variable.