pub fn wait( wait_func: impl FnMut() -> Result<()>, f: &mut impl Write, p: impl AsRef<Path>, id: &str, timeout: Option<Duration>, detect_failure: bool, ) -> Result<()>