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

Tests in tests/lib.rs pollute each other, may cause spurious failure. #1

Open
kennytm opened this issue Aug 29, 2017 · 0 comments
Open

Comments

@kennytm
Copy link

kennytm commented Aug 29, 2017

Generally, Rust runs tests in parallel.

In https://github.com/aesir-vanir/vidar/blob/master/tests/lib.rs, the tests all operate on the same directory structure, and thus a file may be overridden by other tests, for instance

Thread 1 Thread 2
Test no_file()
Test invalid_kind()
setup(Some(most))
Creates all files except int.env
setup(None)
Creates int.env as well
Check Environment::try_from("int")
Exists, returns Ok
Thus assert!(false)
💥

Each test should run inside their own temporary directory, instead of reusing the same env::temp_dir().

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

1 participant