-
Notifications
You must be signed in to change notification settings - Fork 16
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
STM: Catch exceptions in next_state for nicer UX #400
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CI summary for c549513:
Out of 63 runs, 7 failed: 5 were genuine defects and 3 were test suite reliability related |
CI summary for 17514a4:
Out of 63 runs, 1 failed (a genuine defect) None of the failures from the two runs are related to the PR, so I'll merge. |
CI summary for merge to
Out of 38 runs 6 failed with 4 genuine issues and 2 borderline ones (asym, Cygwin threads) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In STM, the
next_state
function describes how the pure model description changes across eachcmd
.As documented, ideally this function should be pure.
Surprises lurk when this is not the case, such as ocaml-gospel/ortac#150 points 1. and 3. since
next_state
is run bothgen_cmds
(sequential),gen_cmds_size
(sequential/parallel), andgen_triple
(parallel)assert
scmds_ok
(sequential) andall_interleavings_ok
(parallel)With no generated input to print this thus yields unhelpful error messages such as:
This PR catches exceptions in
next_state
in these former cases, leaving exception raising to the sequential and parallel QCheck properties, where input can be printed and shrunk.As a result, an end-user instead receives a minimal call sequence giving rise to the exception in both sequential mode:
and in parallel mode:
The PR furthermore