clitools: Attempt to mitigate ETXTBSY some more
Somehow sometimes we still get ETXTBSY on Travis test suite runs
This attempts to mitigate that a little more
@@ -437,10 +437,27 @@ where
}
println!("running {:?}", cmd);
+ let mut retries = 8;
+ let out = loop {
let lock = cmd_lock().read().unwrap();
let out = cmd.output();
drop(lock);
- let out = out.expect("failed to run test command");
+ match out {
+ Ok(out) => break out,
+ Err(e) => {
+ retries -= 1;
+ if retries > 0
+ && e.kind() == std::io::ErrorKind::Other
+ && format!("{}", e).contains("os error 26")
+ {
+ // This is a ETXTBSY situation
+ std::thread::sleep(std::time::Duration::from_millis(250));
+ } else {
+ panic!("Unable to run test command: {:?}", e);
+ }
+ }
+ }
+ };
let output = SanitizedOutput {
ok: out.status.success(),
