mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Currently, we use `sample::Index` and `sample::Selector` to deterministically select parts of our state. Originally, this was done because I did not yet fully understand, how `proptest-state-machine` works. The available transitions are always sampled from the current state, meaning we can directly use `sample::select` to pick an element like an IP address from a list. This has several advantages: - The transitions are more readable when debug-printed because they now contain the actual data that is being used. - I _think_ this results in better shrinking because `sample::select` will perform a binary search for the problematic value. - We can more easily implement transitions that _remove_ state. Currently, we cannot remove things from the `ReferenceState` because the system-under-test would also have to index into the `ReferenceState` as part of executing its transition. By directly embedding all necessary information in the transition, this is much simpler.