nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.68k stars 668 forks source link

Run tests in processes rather than threads with `cargo nextest` #2527

Closed SteveLauC closed 1 week ago

SteveLauC commented 1 month ago

Some tests modify process-wide stuff like signal handler, so we use these locks

https://github.com/nix-rust/nix/blob/70f8fe084a21047278beaaae1ddd0c372d05dfee/test/test.rs#L63-L80

to sequentialize them, TIL that cargo nextest will run tests in processes rather than threads, perhaps this can help us get rid of these locks and potentially fixes some weird test failures.

asomers commented 1 week ago

cargo-nextest is cool, but I don't think that we should rely on it. Even if we use it during CI, we should also ensure that "cargo test" works too.

SteveLauC commented 1 week ago

we should also ensure that "cargo test" works too.

Makes sense, closing the issue.