Skip to main content

arming_a_mid_batch_fault_makes_the_append_fail

Function arming_a_mid_batch_fault_makes_the_append_fail 

pub async fn arming_a_mid_batch_fault_makes_the_append_fail<F: Fixture>(
    open: impl AsyncFn() -> F,
) -> RuleOutcome
Expand description

A fixture that declares MID_BATCH_FAULT supported must arm a fault the store cannot absorb, so the append returns Err.

CF-39, and it exists to make append_is_atomic_under_a_mid_batch_fault non-vacuous. That rule asserts the store holds all of a faulted batch or none of it, with which of the two decided by what append answered — so a fixture whose arm does nothing passes it for free: no fault, Ok, every row present, all-or-nothing satisfied. A capability can then be declared supported, contribute nothing, and produce a green atomicity result for a store nothing has ever faulted. That is the failure CF-18 exists to prevent one level up, where a rule #[cfg]-ed out of the binary is indistinguishable from a rule that passed.

§The wrong implementation is a fixture, and it is a precise one

The trait’s provided arm_mid_batch_fault panics, and its message names this exact mistake — so a fixture that declares the capability and simply forgets the override does not pass vacuously, it aborts loudly. The vacuous pass needs a fixture that overrides arm_mid_batch_fault with an empty body: honest-looking code, no panic, no fault, green. NoopFaultFixture in tests/mutation_coverage/mutants.rs is that fixture, over a completely correct store, and it fails this rule and nothing else.

§What this costs, stated rather than discovered later

ES-18 permits a store to swallow a fault and commit the batch anyway, and that sentence is untouched. What CF-39 constrains is the fixture: a store that can absorb every fault its fixture is able to arm MUST decline the capability with that as its stated reason, rather than declare it and contribute an Ok. The weaker alternative is not a weaker rule, it is no rule at all — firing-and-being-absorbed and never-arming produce the same Ok over the same full log, so an anti-vacuity clause that stops short of demanding Err demands nothing a test can see.

The control append is the anchor. Without it an Err here could be the store refusing a three-event batch for reasons of its own, and the rule would certify a fault that never fired.