From: Eric Huss Date: Tue, 22 May 2018 11:45:46 +0000 (-0700) Subject: Fix test failure in changing_bin_features_caches_targets for Linux. X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2^2~28^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=83e87d42128d07bef733c26bd395d69e99c98655;p=cargo.git Fix test failure in changing_bin_features_caches_targets for Linux. Fixes rust-lang/rust#50962. My theory is that while copying the binary, another thread forked with the fd open. The copy finishes and attempts to exec before the other child execs (and closes the writeable fd). I was able to easily repro this on linux. I ran some stress tests of this fix locally on linux and on appveyor, and was unable to trigger it again. --- diff --git a/tests/testsuite/freshness.rs b/tests/testsuite/freshness.rs index 7df638cfb..edf9c74dd 100644 --- a/tests/testsuite/freshness.rs +++ b/tests/testsuite/freshness.rs @@ -522,7 +522,7 @@ fn changing_bin_features_caches_targets() { let foo_proc = |name: &str| { let src = p.bin("foo"); let dst = p.bin(name); - fs::copy(&src, &dst).expect("Failed to copy foo"); + fs::hard_link(&src, &dst).expect("Failed to link foo"); p.process(dst) };