-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete unseen transitions in state machine test #388
Conversation
thank you @henriiik, will take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left one comment, the rest of the changes make a lot of sense to me. @tzemanovic knows this code best though so we'll wait for his feedback :)
thanks for the contribution 👍
999b32f
to
0aa8087
Compare
Thanks for picking this up, let me know if you want me to help in any way :) |
Thanks again @henriiik, I'd like to add the following changes:
The last 2 fixup commits make these changes, if you could pls check them over to make sure that this still works for your use-case. |
I've opened #434 with the fixups squashed, I can push it back here if you're happy with the changes |
@tzemanovic Looks good to me! |
849cb31
to
7634f32
Compare
This PR adds a new shrinking step to
proptest_state_machine::SequentialValueTree
that deletes all transitions not seen by the test runner as the first step. This is related to #387.To do that it changes the value type from a
Vec<Transition>
to a new wrapper typeObservedVec<T>
. This new type contains a counter that is shared withSequentialValueTree
and keeps track of how many transitions have been seen by the test runner.The shared counter is reset on each call to
simplify
/complicate
, therefore it is no longer valid to callcurrent
multiple times without callingsimplify
and/orcomplicate
in between.Given my (admittedly limited) understanding of how
proptest
works this is not an issue as the intention is for the value tree to be used in a loop where each iteration starts with a call tocurrent
which produces a value that is used in a test run and based on the test resultsimplify
orcomplicate
is called at least one time before the next iteration.Any feedback would be welcome!