Tarpaulin: Running doctests causes tarpaulin to deadlock itself

Created on 25 Apr 2020  路  9Comments  路  Source: xd009642/tarpaulin

I'm using tarpaulin for my gotham-restful crate and today tried running tarpaulin doctest coverage. This resulted in the error message Blocking waiting for file lock on package cache and after a few dependencies have been compiled a complete deadlock where I have to Ctrl+C tarpaulin. I tried to give tarpaulin its own target directory to make sure it didn't collide with rls running in the background, but that didn't help either. This is the command I tried:

cargo tarpaulin -v \
    --target-dir target/tarpaulin \
    --all --all-features \
    --exclude-files 'gotham_restful_derive/*' \
    --exclude-files 'example/*' \
    --ignore-panics \
    --ignore-tests \
    --out Html \
    --run-types Doctests

If I swap Doctests for Tests, everything works fine and I get no deadlock, but also no doctest coverage. In case this is relevant:

$ cargo -V
cargo 1.43.0
$ cargo tarpaulin -V
cargo-tarpaulin version: 0.12.3
$ uname -srm
Linux 5.6.6-arch1-1 x86_64
Cargo bug

Most helpful comment

Fix for this is now released anymore doctest issues observed let me know in #455 :+1:

All 9 comments

Just to double check you are using a nightly version of the rust compiler? doctest coverage relies on some nightly features in rustc.

Well, I wasn't, but I get the error message twice if I add +nightly to the above command.

Well I guess it's consistent in some sense... Also just checked the code and I add the +nightly to my own cargo invocation (since i call off to cargo to build the tests) if it's a doctest run, forgot it did that :sweat_smile:.

I'll have a look into this and let you know when I get to the bottom of it :+1:

I'm also having this issue, I think. [INFO tarpaulin] Building project will never finish.
I'm using the following command to run tarpaulin:

cargo +nightly tarpaulin --run-types Tests Doctests --ignore-tests

tarpaulin 0.11.1 works fine, 0.12.0 & 0.12.3 don't. Everything works fine with just --run-types Tests.

I'm seeing this issue as well on my crate Isahc. Running the command

cargo +nightly tarpaulin -v --debug --run-types Doctests

will always hang when compiling a random dependency. It is a different step every time that it hangs on. With debug output, you can watch logs fly by very quickly as it compiles dependencies, then randomly will stop and hang forever.

  • Rustc version: rustc 1.44.0-nightly (ce93331e2 2020-04-17)
  • Tarpaulin version: cargo-tarpaulin version: 0.12.3

Other run types work fine.

Interestingly when this happens, Cargo's Building [====> ] progress bar will instantly disappear before the hang.

There's an issue #455 to track some improvements to the doctest stuff if anyone wants to comment on whether any issues seem to have disappeared with the newest nightly compiler or latest tarpaulin release.

Also there's a commit on the branch doctest_improvements that may solve the hanging issue for people. I'll try it on some of your projects tomorrow hopefully and see if I can reproduce the issue and then if the commit solves it

@sagebind I recreated the hanging issue and solved it on your crate. I'll also test on everyone elses crates to see if those are the same issues or other ones.

I'm also working on some other doc test issues and hopefully I'll have a release later this week (or next week) with the fix in and some others! I put some technical details of the issue on #455 if you're interested

Fix for this is now released anymore doctest issues observed let me know in #455 :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hawkw picture hawkw  路  7Comments

paulvt picture paulvt  路  5Comments

svenstaro picture svenstaro  路  7Comments

JP-Ellis picture JP-Ellis  路  9Comments

xd009642 picture xd009642  路  9Comments