pa-05 — Verification
One command
cd pa-05-delivery-semantics-saga && bash scripts/verify.sh
What the tests prove
| Test | Invariant |
|---|---|
TestOutboxAtomicAndAtLeastOnce | crash-before-mark re-publishes; idempotent sink → effectively-once; no unpublished left |
TestOutboxNoLostEventsVsBrokenDualWrite | broken dual write loses the event; outbox keeps state↔event 1:1 |
TestSagaHappyPath | all forward steps run; nothing compensated |
TestSagaCompensatesInReverse | a mid-saga failure compensates completed steps in reverse order |
TestSagaResumeAfterCrash | resuming from persisted progress runs only remaining steps |
All under -race.
What "green" does NOT guarantee
- No real DB/CDC. The "transaction" is a mutex; production uses a DB transaction + Debezium or a robust polling publisher.
- No durable orchestrator.
RunFrommodels resume; a real saga persists per-saga state with retries/timeouts/alerting. - Compensation reliability is on you. Failed compensations need retries + alerting (pa-09); not handled here.