cli: Enable configurable startup wait (#842)

This commit is contained in:
bonedaddy 2021-10-06 09:14:19 -07:00 committed by GitHub
parent 54a6e9cf37
commit 6a9e6a2b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -462,6 +462,7 @@ pub struct Test {
pub genesis: Option<Vec<GenesisEntry>>,
pub clone: Option<Vec<CloneEntry>>,
pub validator: Option<Validator>,
pub startup_wait: Option<i32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]

View File

@ -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() {