(target: &PairingTarget, timeout: Duration)
| 2231 | } |
| 2232 | |
| 2233 | fn wait_for_pairing_target(target: &PairingTarget, timeout: Duration) -> anyhow::Result<()> { |
| 2234 | let deadline = Instant::now() + timeout; |
| 2235 | while Instant::now() < deadline { |
| 2236 | if http_get_json(&target.http_url, "/api/health").is_ok() { |
| 2237 | return Ok(()); |
| 2238 | } |
| 2239 | std::thread::sleep(Duration::from_millis(50)); |
| 2240 | } |
| 2241 | anyhow::bail!( |
| 2242 | "Timed out waiting for SimDeck {} at {}", |
| 2243 | target.target, |
| 2244 | target.http_url |
| 2245 | ) |
| 2246 | } |
| 2247 | |
| 2248 | fn service_is_healthy(metadata: &ServiceMetadata) -> bool { |
| 2249 | http_get_json(&metadata.http_url, "/api/health").is_ok() |
no test coverage detected