1---2name: jepsen-testing3description: Jepsen-style correctness testing for distributed systems under faults (partitions, crashes, clock skew) using concurrent operation histories and formal checkers (linearizability/serializability and Elle-style anomalies). Use when designing, implementing, or running Jepsen tests, or interpreting histories/violations.4---56# Jepsen Testing78## Intake910- Identify the system under test and the exact client surface (Redis, S3, Kafka, HTTP, gRPC).11- Define what "acknowledged" means for each operation (what does the client treat as committed).12- Write the claimed consistency guarantees as a checkable property (linearizable register, RYW, monotonic reads, serializable txns).13- Specify the failure model to test (crash-stop, partitions, clock skew, disk stalls, restarts).14- Decide whether the test must be multi-surface (write via Redis, read via S3) to validate cross-frontend coherence.1516## Workload Design1718- Prefer the smallest workload that can falsify the claim.19- Use a mix of reads and writes that creates ambiguous interleavings.20- Add a "witness" invariant that is easy to explain:21- Lost acknowledged write.22- Read sees a value that cannot be explained by any sequential execution respecting real-time order.23- List-append: element lost/duplicated or observed order implies a cycle.2425## Checker Selection2627- Register or map semantics: use a linearizability checker.28- Transactional / multi-object semantics: use Elle-style anomaly detection (write cycles, dirty reads, lost updates).29- If linearizability is too strong for the product, explicitly select a weaker model and encode it (do not silently downgrade).3031## Fault (Nemesis) Selection3233- Partitions: majority/minority splits, bridge partitions, flapping partitions.34- Process faults: kill and restart, node reboot, rolling restarts.35- Time faults: clock offsets and jumps if the system relies on time.36- Storage faults: fsync latency, I/O stalls, disk-full behavior (only if safe and reversible).3738## Run and Minimize3940- Start with a short, low-concurrency run until the harness is stable.41- When a failure appears, minimize by reducing:42- Keys, operation count, and concurrency.43- Fault intensity and schedule complexity.44- Preserve determinism (fixed seeds, fixed partition schedule) so a failing history can be reproduced.4546## Reporting4748- State the exact claim under test and the precise pass/fail property.49- Include the workload, nemesis schedule, and a minimal failing history excerpt.50- Distinguish availability failures (timeouts) from safety failures (incorrect ok results).5152