Fix path::deep_dependencies_trigger_rebuild often failing in CI

This commit is contained in:
Dale Wijnand 2018-08-30 07:31:51 +02:00
parent 1f4910060f
commit 274c162b2a
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF

View File

@ -343,11 +343,11 @@ fn deep_dependencies_trigger_rebuild() {
//
// We base recompilation off mtime, so sleep for at least a second to ensure
// that this write will change the mtime.
sleep_ms(1000);
File::create(&p.root().join("baz/src/baz.rs"))
.unwrap()
.write_all(br#"pub fn baz() { println!("hello!"); }"#)
.unwrap();
sleep_ms(1000);
p.cargo("build")
.with_stderr(&format!(
"[COMPILING] baz v0.5.0 ({}/baz)\n\
@ -361,7 +361,6 @@ fn deep_dependencies_trigger_rebuild() {
)).run();
// Make sure an update to bar doesn't trigger baz
sleep_ms(1000);
File::create(&p.root().join("bar/src/bar.rs"))
.unwrap()
.write_all(
@ -370,6 +369,7 @@ fn deep_dependencies_trigger_rebuild() {
pub fn bar() { println!("hello!"); baz::baz(); }
"#,
).unwrap();
sleep_ms(1000);
p.cargo("build")
.with_stderr(&format!(
"[COMPILING] bar v0.5.0 ({}/bar)\n\