-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add timeouts #136
Comments
Ok... I guess you can use Anyway I can try to introduce this feature in rstest. I'm not an expert but I guess that aync timeout depend from which runtime do you use and this can be very tricky to handle. |
You can make timeouts runtime-agnostic: https://docs.rs/futures-timer/latest/futures_timer/index.html |
Seams great!! Thanks |
Ok, I wrote a proof of concept But before start I need to refactor the project to split procedural macro crate from utility functions. |
TODO
|
@la10736 Timeout doesn't seem to work with async fixtures: #[rstest]
#[timeout(std::time::Duration::from_secs(100))]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_sanity_flow(#[future] service: EchoService) {
let _ = service.await;
assert_eq!(1, 1);
} error:
|
Ok... I missed it in my test :( Can you open a new ticket for this bug/limit? I've just forget to close this ticket before. |
Sure! |
The option to timing out the test should be a parameter. E.g.,:
When async is detected, a timeout future can be wrapped around the test itself, terminating if it times out.
The text was updated successfully, but these errors were encountered: