From 6a9e6a2b2043e34fb89345c660f03915cf339e9d Mon Sep 17 00:00:00 2001 From: bonedaddy <17089485+bonedaddy@users.noreply.github.com> Date: Wed, 6 Oct 2021 09:14:19 -0700 Subject: [PATCH] cli: Enable configurable startup wait (#842) --- cli/src/config.rs | 1 + cli/src/lib.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/src/config.rs b/cli/src/config.rs index 4fced6fad..e2d74c77c 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -462,6 +462,7 @@ pub struct Test { pub genesis: Option>, pub clone: Option>, pub validator: Option, + pub startup_wait: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 5c586c60f..f8650b45a 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1695,7 +1695,11 @@ fn start_test_validator( // Wait for the validator to be ready. let client = RpcClient::new(rpc_url); let mut count = 0; - let ms_wait = 5000; + let ms_wait = cfg + .test + .as_ref() + .and_then(|test| test.startup_wait) + .unwrap_or(5_000); while count < ms_wait { let r = client.get_recent_blockhash(); if r.is_ok() {