-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
util/must: convenience wrapper for making many assertions #107418
Comments
cc @cockroachdb/test-eng |
Immediately hit this limitation
|
A couple of other options:
|
|
See #106508.
It's common to execute many assertions at once, see e.g.
storage.assertMVCCIteratorInvariants()
. Returning errors from each individual assertion can get tedious and clutter the code. It would be convenient to run many assertions in a block, if we can do so efficiently.Here's an example of how this might look:
This would be implemented by throwing panics on assertion failures, and recovering the panic in
must.With
. A specific panic value would be thrown, wrapping the assertion error, and only this value would be recovered -- other panics would be propagated.must.With
itself would handle the assertion failure like any other assertion failure, i.e. fatal or propagate.Jira issue: CRDB-30031
The text was updated successfully, but these errors were encountered: