-
Notifications
You must be signed in to change notification settings - Fork 159
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
How to run proptest
within MIRI
?
#253
Comments
Thanks for reporting this. This is due to proptest's failure persistence which tries to load a failure persistence file to detect seeds of previous failed runs. proptest does allow you disable this, after which proptest will run under MIRI without issue. There are a few options for disabling proptest which I'll show using the example from the book:
which running
results in
The first option, which is the only that maintains MIRI isolation is through explicit proptest config:
which after running
The obvious downside is that there is no failure persistence, even when not running in MIRI. The next few options all affect MIRI's isolation. Just running the original example with the following flags works, and is what MIRI actually suggests in the error message
both result in passing tests, but the behaviors are different. The first one does load the persistence file and runs any detected seeds, the second one fails to load the persistence file and continues with arbitrary test cases. Lastly, since v1.1, you can disable failure persistence with an env var: Unfortunately you still need to pass the
Hope this helps and sorry for the delay in getting to this issue! |
You can also do this. PROPTEST_DISABLE_FAILURE_PERSISTENCE=true MIRIFLAGS='-Zmiri-env-forward=PROPTEST_DISABLE_FAILURE_PERSISTENCE' cargo miri test |
For context, I would like the tests ran in
proptest
to run underMIRI
, but MIRI does not acceptgetcwd
in isolation mode (which we require in our tests).Running results in
Full log here.
The text was updated successfully, but these errors were encountered: