Skip to content

Commit

Permalink
brfs: Sleep a bit after mounting the filesystem (#5819)
Browse files Browse the repository at this point in the history
This makes the tests a lot more stable.

Fixes #5813
  • Loading branch information
illicitonion committed May 14, 2018
1 parent f763f58 commit ae02999
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rust/engine/fs/brfs/src/main.rs
Expand Up @@ -560,6 +560,10 @@ pub fn mount<'a, P: AsRef<Path>>(
debug!("About to spawn_mount with options {:?}", options);

let fs = unsafe { fuse::spawn_mount(BuildResultFS::new(store), &mount_path, &options) };
// fuse::spawn_mount doesn't always fully initialise the filesystem before returning.
// Bluntly sleep for a bit here. If this poses a problem, we should maybe start doing some polling
// stats or something until the filesystem seems to be correct.
std::thread::sleep(std::time::Duration::from_secs(1));
debug!("Did spawn mount");
fs
}
Expand Down Expand Up @@ -840,7 +844,6 @@ mod test {
assert!(!file::is_executable(&roland));
}

/* TODO: See https://github.com/pantsbuild/pants/issues/5813.
#[test]
fn files_are_correctly_executable() {
let store_dir = TempDir::new("store").unwrap();
Expand Down Expand Up @@ -872,7 +875,6 @@ mod test {
assert!(file::is_executable(&virtual_dir.join("feed")));
assert!(!file::is_executable(&virtual_dir.join("food")));
}
*/

pub fn digest_to_filepath(digest: &hashing::Digest) -> String {
format!("{}-{}", digest.0, digest.1)
Expand Down

0 comments on commit ae02999

Please sign in to comment.