(path: &Path, timeout: Duration, label: &str)
| 1221 | } |
| 1222 | |
| 1223 | fn wait_for_path(path: &Path, timeout: Duration, label: &str) -> Result<(), String> { |
| 1224 | let deadline = Instant::now() + timeout; |
| 1225 | let mut interval = Duration::from_millis(5); |
| 1226 | while !path.exists() { |
| 1227 | if Instant::now() >= deadline { |
| 1228 | return Err(format!( |
| 1229 | "{label} did not appear within {:.1}s: {}", |
| 1230 | timeout.as_secs_f64(), |
| 1231 | path.display() |
| 1232 | )); |
| 1233 | } |
| 1234 | std::thread::sleep(interval); |
| 1235 | interval = (interval * 2).min(Duration::from_millis(200)); |
| 1236 | } |
| 1237 | Ok(()) |
| 1238 | } |
| 1239 | |
| 1240 | fn hash_path_id(path: &Path) -> String { |
| 1241 | let mut hash: u64 = 0xcbf2_9ce4_8422_2325; |
no test coverage detected