Expand description
A fault-injecting [ObjectStore] wrapper, for drills against a store that
misbehaves.
Every production bound in this crate – the retry budget, the retry
deadline, the request and connect timeouts – exists because a real object
store throttles, stalls, and fails. None of that is reachable from a test
that only ever meets a store which answers. FaultInjectingStore wraps
any other store and, per operation, delays the call and then fails it with
the error the backend would have produced.
The failure schedule is deterministic, not random: a rate of 500 per thousand fails every second call to that operation, always the same ones, so a suite that asserts on which call failed asserts on a fact rather than on a seed.
This is a testing seam. Nothing in the broker’s serving path constructs it.
Tests can wrap an existing store directly or use build_faulty_object_store
to hand a fault policy to code that takes an Arc<dyn ObjectStore>.
Structs§
- Fault
Injecting Store - An [
ObjectStore] that delays and fails calls according to aFaultPolicy, delegating everything it does not fail to an inner store. - Fault
Policy - Which operations misbehave, and how.
- OpFault
- What one operation class does under fault injection.
Enums§
- Fault
Kind - What a failing call fails with.
- StoreOp
- The operation classes a
FaultPolicycan single out.
Functions§
- build_
faulty_ object_ store - Build the store
cfgselects and wrap it inpolicy.