Ver Fonte

cli: Enable configurable startup wait (#842)

bonedaddy há 4 anos atrás
pai
commit
6a9e6a2b20
2 ficheiros alterados com 6 adições e 1 exclusões
  1. 1 0
      cli/src/config.rs
  2. 5 1
      cli/src/lib.rs

+ 1 - 0
cli/src/config.rs

@@ -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)]

+ 5 - 1
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() {