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

[windows] lots of tests running in parallel may cause "leaky" warnings #1469

Open
zaneduffield opened this issue Apr 26, 2024 · 3 comments
Open

Comments

@zaneduffield
Copy link
Contributor

zaneduffield commented Apr 26, 2024

When I run my tests with datatest-stable (0.2.9), using nextest as the runner, a semi-random number of tests are marked as leaky.

This seems to only depend on how many tests the crate has, and not what the tests are doing.

I have an example repo here: https://github.com/zaneduffield/datatest_leak_issue
That repo has 1000 test files, which are used with a no-op test function.
When I run cargo nextest run on it, about 40% of the tests are marked as 'leaky'.
One issue that may be related is how slow this is: ~17s on my machine compared to ~0.2s with cargo test.

@zaneduffield
Copy link
Contributor Author

I should mention that I am running this on Windows.

@zaneduffield
Copy link
Contributor Author

Maybe this is related to AV getting in the way (https://nexte.st/book/antivirus-gatekeeper). Even if that is the case, I'm not sure why the tests would be considered leaky.

@sunshowers
Copy link
Member

Thanks for the report. It does seem like antivirus getting in the way. Have you tried the new "dev drive" feature on Windows?

Leak detection works by monitoring the stdout and stderr file descriptors after the file has closed. If antivirus or something else is keeping the fds open, this issue will be hit. You can bump up the timeout with the "leak-timeout" parameter.

I think this isn't really a datatest-stable issue, more of a nextest issue. Moving it there.

@sunshowers sunshowers changed the title Tests are considered 'leaky' when run with nextest [windows] lots of tests running in parallel may cause "leaky" warnings Apr 26, 2024
@sunshowers sunshowers transferred this issue from nextest-rs/datatest-stable Apr 26, 2024
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