Skip to content

Commit

Permalink
Update test_server.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvlach committed Jun 1, 2024
1 parent 0d6aace commit 3dd3a4d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions agdb_server/tests/test_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,15 @@ impl Drop for TestServer {
}
}
}

pub async fn wait_for_ready(api: &AgdbApi<ReqwestClient>) -> anyhow::Result<()> {
for _ in 0..RETRY_ATTEMPS {
if api.status().await.is_ok() {
return Ok(());
}

std::thread::sleep(RETRY_TIMEOUT);
}

anyhow::bail!("Server not ready")
}

0 comments on commit 3dd3a4d

Please sign in to comment.