-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Steno expects action implementations to meet a few invariants (these come from distributed sagas in general):
- actions are idempotent
- undo actions are idempotent
- "undo" should be commutative with the action. That is, if an undo action is executed followed by a re-execution of the action itself, the net result should be as though the undo action ran last.
- what others?
We cannot test that actions are correct or even that they always obey these invariants. But we could empirically test a lot of different cases, like:
- after an action runs to completion, run it again. It should succeed again and the resulting external state should be equivalent. (Steno can't know the second part but the consumer can help here.)
- after an undo action runs to completion, run it again. It should succeed again and the external state should be equivalent.
- run the action again after the undo action completes. It should succeed again and the external state should be equivalent.
If we could inject a retryable error into either the action or undo action, then we could also test that they can fail (multiple times in a row), then remove the injected error, and then run it again and have them succeed.
All of this requires that the consumer be able to tell us whether the external states of the world are equivalent (or, maybe equivalently, whether they've changed).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels