-
Notifications
You must be signed in to change notification settings - Fork 233
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
Make get_put_monitor_eqc pass deterministically #857
Conversation
* Change check_state to be the optional invariant callback. * Just return true from postcondition since it was only used to check the state. * remove unneccessary `timer:sleep/1` calls * Poll for folsom stat changes instead of relying on timer:sleep. This will fix the test on slow machines such as the builders. It also makes the test run a lot faster as it no longer sleeps arbitrarily. * Move test initialization out of the initial_state callback * Log the metric that failed for invariants * Poll active stats during get and put fsm shutdown/exit since the count needs to be decremented * swap ordering of monitoring the pid and sending it a kill msg in `end_and_wait/2`
Huge improvement but not 100% there yet. Still seeing a regular failure due to a race when running 10k iterations. the test passes using
|
?FORALL(Cmds, commands(?MODULE), begin | ||
crypto:start(), | ||
application:start(folsom), | ||
reset_test_state(), |
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.
its good to do clean up after the iteration runs, also. That way the last iteration doesn't leave around artifacts that mess with tests that run later in the suite.
* process errors also decrement the active process count, so poll for those * syncrhonously run the noproc tests to avoid races * Run tests for 5000 iterations * Cleanup non-idomatic assertions in invariant/1
I used |
+1 merge. 110k iterations passed. nice work. |
Make get_put_monitor_eqc pass deterministically
the state.
timer:sleep/1
callsthe test on slow machines such as the builders. It also makes the test
run a lot faster as it no longer sleeps arbitrarily.
count needs to be decremented
end_and_wait/2