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

Since removing timebomb stuck tests do not timeout and fail #6

Closed
Nemo157 opened this issue May 16, 2020 · 3 comments
Closed

Since removing timebomb stuck tests do not timeout and fail #6

Nemo157 opened this issue May 16, 2020 · 3 comments
Assignees

Comments

@Nemo157
Copy link

Nemo157 commented May 16, 2020

Describe the bug
When I originally started using ntest::timeout it was because I had tests that would infinitely loop and never complete. Back on version 0.3.4 this worked well, and I happened to never have updated in that project. When trying to use it again in a new project when diagnosing a stuck test I noticed newer versions would no longer deal with this.

To Reproduce
Create a crate containing

#[test]
#[ntest::timeout(1000)]
fn foo() {
    loop {}
}

run cargo test

Expected behavior
The test to fail after 1 second

@becheran becheran self-assigned this May 19, 2020
@becheran
Copy link
Owner

I had a problem with the timebomb dependency. I "fixed" the issue by making it a simple max_time() function instead of a real timeout which requires another thread. I will have a look into it again and see if I can find a more satisfying solution. I keep you updated

@becheran
Copy link
Owner

I had some issues using normal functions from within a procedural macro. With version 7.1 I found a solution that works. This should have solved your issue with ntest.

@Nemo157
Copy link
Author

Nemo157 commented May 25, 2020

Awesome, thanks a lot 😄

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