Tech
Test a Saga When Compensation Times Out and the Message Is Delivered Twice
A saga test that stops after “payment succeeded, inventory failed, refund called” assumes compensation is reliable. It is another distributed operation, so test it under the same faults.
Use this sequence:
1. payment capture succeeds
2. inventory reservation times out
3. refund succeeds at provider
4. refund response is lost
5. compensation message is delivered again
6. late inventory-failed event arrives again
The invariant is not “refund endpoint called once.” It is:
...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to