xd009642 / tarpaulin

A code coverage tool for Rust projects
https://crates.io/crates/cargo-tarpaulin
Apache License 2.0
2.54k stars 179 forks source link

[BUG] - Inconsistent line coverage errors. #1083

Open JosiahBull opened 2 years ago

JosiahBull commented 2 years ago

Describe the bug I've been seeing inconsistent coverage.

Screenshot from 2022-08-27 20-09-36

Note that this error is positional for some reason. Swapping the impl for CommError with Auth means the error appears on Auth instead.

Tagging #351 , though it may be user error at this point so don't want to add to that thread right away.

To Reproduce

git clone https://github.com/riptide-org/ws-com-framework/
cd ws-com-framework
cargo tarpaulin --out lov --all #version 0.20.1

Expected behavior I expected the line coverage to be consistent for the TryFrom implementation.

xd009642 commented 1 year ago

If you were using llvm coverage this should be improved in the latest release. If you're using ptrace it's potentially unavoidable - there's a bunch of concurrency nightmares with tracing multi-threaded applications which make consistency maybe impossible. Things like --test-threads 1 is an answer.

Sorry for not getting back sooner, I'll keep this issue open if you want to check back in. But otherwise I'll likely close in a month or so