(metadata: &ServiceMetadata, timeout: Duration)
| 2217 | } |
| 2218 | |
| 2219 | fn wait_for_service(metadata: &ServiceMetadata, timeout: Duration) -> anyhow::Result<()> { |
| 2220 | let deadline = Instant::now() + timeout; |
| 2221 | while Instant::now() < deadline { |
| 2222 | if service_is_healthy(metadata) { |
| 2223 | return Ok(()); |
| 2224 | } |
| 2225 | std::thread::sleep(Duration::from_millis(50)); |
| 2226 | } |
| 2227 | anyhow::bail!( |
| 2228 | "Timed out waiting for SimDeck service at {}", |
| 2229 | metadata.http_url |
| 2230 | ) |
| 2231 | } |
| 2232 | |
| 2233 | fn wait_for_pairing_target(target: &PairingTarget, timeout: Duration) -> anyhow::Result<()> { |
| 2234 | let deadline = Instant::now() + timeout; |
no test coverage detected