Manishearth / compiletest-rs

An extraction of the compiletest utility from the Rust compiler
Apache License 2.0
216 stars 59 forks source link

Lock coverage files #259

Closed smoelius closed 2 years ago

smoelius commented 2 years ago

This PR suggests a method for locking coverage files when writing to them.

Currently, there appears to be a race. Specifically, the tester crate runs test functions in separate threads, similar to how libtest does. Thus, the test functions' writes to the coverage file can become interleaved, causing the file to become corrupted.

I have observed corrupted coverage files while testing Clippy, and I suspect this to be the cause.

smoelius commented 2 years ago

Thanks, @Manishearth.

smoelius commented 1 year ago

@Manishearth Would it be possible to get a new release with this fix?

I suspect this bug was in part the cause of the recent rustup failure: https://github.com/rust-lang/rust-clippy/actions/runs/3106438892/jobs/5033324694#step:11:911

Munksgaard commented 1 year ago

@smoelius v0.9.0 has now been published and includes your fix :-)

Thanks for the contribution!