Closed Maximkaaa closed 2 years ago
I would love to change the default behavior here once https://github.com/rust-lang/rust/issues/91092 is fixed.
Oh, I didn't even know about the -- --test-threads=1
option. Yes, this explain the difference, since -j
and --test-threads
work differently.
Maybe consider adding a note about this in the readme until that issue is fixed. Because it took me quite a while to figure out why my tests were passing with cargo test
but not with cargo llvm-cov
.
Maybe consider adding a note about this in the readme until that issue is fixed. Because it took me quite a while to figure out why my tests were passing with
cargo test
but not withcargo llvm-cov
.
Sounds good to me!
This behavior has been documented by #209 (thanks @Maximkaaa), so I'm going to close this in favor of the upstream issue.
It seems to me that
llvm-cov
runs all the tests in a single thread. I guess there might be a good reason for that, but in some cases it can result in some tests failing which pass withcargo test
. For example, if the test or the code itself usesthread_local
storage for something, its contents can be different in these two cases.Even when the
cargo test
command is run without parallelism (with--jobs 1
), it still creates a new thread for each test. It would be nice ifllvm-cov
would do the same to make the test results be the same.