-
-
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
Detached tasks in tests #2699
Comments
This caught me off guard today - my code is using task::spawn without joining on the result because I don't want to block until the task finishes. But it meant that a bunch of panicking tasks were getting through CI without anyone noticing |
Can we remove the |
In theory, I am OK w/ the idea of adding a I would read a proposal. |
@carllerche would it be acceptable to panic when building a multi-threaded scheduler that has been configured to not |
It's also not obvious for the current thread scheduler. That scheduler can also have multiple concurrent calls to |
Since it's only useful for testing atm, why not let that be unspecified, and let the particular thread that happens to run into the panic just panic? |
Alternatively, a new TestRuntime(tiny wrapper for single thread Runtime) can be introduced that |
Has anything changed on this front? Do tests still need to |
For the case of panics, #4770 was recently merged, but it's not yet released. |
Closing in favor of #4516. |
It seems to me like #4516 is (implemented on I'm thinking OTOH, it does mean a change in behavior for That said, if you think it doesn't make sense I won't insist. Just wanted to raise the point that #4516 is neither necessary nor sufficient to stabilize for this to work better for testing use cases :) |
It's way too breaking of a change to make that argument. |
What should we do about detached tasks in tests? Can we help people out by detecting silent mistakes?
The text was updated successfully, but these errors were encountered: