-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Description
It seems that async fixture + timeout doesn't work. I didn't dig in, but I assume the args are double-used, hence being moved.
#[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:
196 | #[rstest]
| --------- captured by this `Fn` closure
...
199 | async fn test_sanity_flow(#[future] service: EchoService) {
| ^^^^^^^
| |
| captured outer variable
|
Activity
la10736 commentedon Jun 27, 2022
Thx... I'm investigating... but maybe I need some time to fix it :(
aviramha commentedon Jun 27, 2022
No problem, I appreciate you for maintaining this crate and being responsive. I'd suggest to send a PR but me + proc macros are terrible enemies 🙉
la10736 commentedon Jun 27, 2022
Ok the problem is bigger.... async timeout dosn't work with fixture.
la10736 commentedon Jun 27, 2022
I found the fix.... It's simple but I don't know when I can publish it .... I hope to find some time in the next days
Close Async fixture + Timeout doesn't work #154
#154 Changelog
la10736 commentedon Jun 27, 2022
Just as note it was that timeout annotated test cannot use dependency (case values, values or fixtures) that doesn't implement copy trait.
la10736 commentedon Jun 27, 2022
Released.... sorry for this crappy bug