-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Don't start the reactor when running Miri #3360
Comments
I suppose something like that could work. |
@Koxiaet |
@blasrodri Even better, |
FWIW, this should be done with care. So when a library does this, it might be worth pointing this out somewhere in the documentation, at least. |
It's possible that it is better to update tests to not enable IO so we don't run into the miri error on starting epoll. Then we can do it selectively on tests that don't depend on epoll, but are still e.g. threaded. |
Do you mean by modifying the proc macro, and changing the |
No, I meant modifying each test directly rather than modifying the macro. Tests which actually use IO should not be modified of course, as they simply cannot run with miri. |
Until Miri is stabilized as part of the rust stable channel, I am inclined to not factor it in. The runtime builder provides sufficient configuration options to disable the IO driver. |
A quick search on |
Oh yea, you are right. I forgot that |
The recommendation for non-Linux users that need file system access or |
It can be useful to run async tests in Miri. However,
#[tokio::test]
will currently attempt to start the reactor, which will cause an error in Miri as it isn't supported. By only starting the reactor on#[cfg(not(miri))]
, we will be able to run tests using Miri without having to usefutures_executor::block_on
or something like that.The text was updated successfully, but these errors were encountered: