Skip to content

Some state machine test fixes and refactorings #556

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

Merged
merged 5 commits into from
Feb 17, 2025
Merged

Conversation

jorisdral
Copy link
Collaborator

No description provided.

@jorisdral jorisdral marked this pull request as draft January 29, 2025 18:15
@jorisdral jorisdral self-assigned this Jan 29, 2025
@jorisdral jorisdral marked this pull request as ready for review January 30, 2025 09:24
There are cases where we allow the model and SUT to disagree, for example in the
presence of injected disk faults. Previously, this allowed disagreement was
encoded in the `Eq Err` instance, but I (Joris) had forgotten that we should
actually use the `Eq (Obs h a)` instance for this.
We're not using it, but might be useful in the future. Seemed wasteful to throw
it away.
Previously, if `checkForgottenRefs` threw an error, no counterexample output
would be produced by the test. Now that is a property, counterexamples are
properly printed again.
Changes include:

* Add a new `ErrOther` model error.
* Define a separate error handler for each specific type of SUT exception.
* Create `realErrorHandlers`, the set of error handlers used on the SUT.
* Define a new `catchAllErrorHandler`, which matches on `SomeException` and maps
  it to `ErrOther`.

The main intent of this refactoring is to map *all* SUT exceptions to a model
`Err`. If a SUT exception is not explicitly caught by specialised error handlers
such as `lsmTreeErrorHandler`, then `catchAllErrorHandler` will make sure to
catch the exception and map it to the catch-all `ErrOther` value.

As a result, we get proper counterexample output, which would not happen if we
were to get an uncaught exception in the test.
@jorisdral jorisdral enabled auto-merge February 17, 2025 13:10
@jorisdral jorisdral added this pull request to the merge queue Feb 17, 2025
Merged via the queue into main with commit 32c94be Feb 17, 2025
27 checks passed
@jorisdral jorisdral deleted the jdral/qls-fixes branch February 17, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants