feat: CLI: wait for ftest server to start before scheduling job

This commit is contained in:
Aravinth Manivannan 2023-10-04 19:20:16 +05:30
parent d6a5853d34
commit 8b0e05ba14
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

@ -91,6 +91,21 @@ async fn main() -> std::io::Result<()> {
Command::Test { path } => {
let ctx: Arc<dyn MinAppContext> = Arc::new(CliCtx::new());
let serv = basic_server(ctx.clone()).await;
loop {
log::info!("Waiting for server to start...");
let res = reqwest::get(&format!(
"http://localhost:29130{}",
api::v1::meta::META.build_details
))
.await;
if res.is_ok() {
log::info!("Waiting server started");
break;
}
tokio::time::sleep(std::time::Duration::new(2, 0)).await;
}
crate::runner::suite::SuiteRunnerState::run_proxy(ctx.as_ref());
let (suite_results, init_containers) =
crate::runner::target::run_target(ctx.as_ref(), path.clone()).await;