Skip to content
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

Async fixture + Timeout doesn't work #154

Closed
aviramha opened this issue Jun 27, 2022 · 6 comments
Closed

Async fixture + Timeout doesn't work #154

aviramha opened this issue Jun 27, 2022 · 6 comments

Comments

@aviramha
Copy link

aviramha commented Jun 27, 2022

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
    |                   
@aviramha aviramha mentioned this issue Jun 27, 2022
@la10736
Copy link
Owner

la10736 commented Jun 27, 2022

Thx... I'm investigating... but maybe I need some time to fix it :(

@aviramha
Copy link
Author

aviramha commented 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
Copy link
Owner

la10736 commented Jun 27, 2022

Ok the problem is bigger.... async timeout dosn't work with fixture.

@la10736
Copy link
Owner

la10736 commented 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

la10736 added a commit that referenced this issue Jun 27, 2022
@la10736 la10736 closed this as completed Jun 27, 2022
@la10736
Copy link
Owner

la10736 commented 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
Copy link
Owner

la10736 commented Jun 27, 2022

Released.... sorry for this crappy bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants