diff --git a/teller-cli/tests/flow_test.rs b/teller-cli/tests/flow_test.rs index 981c9b24..fb0fc143 100644 --- a/teller-cli/tests/flow_test.rs +++ b/teller-cli/tests/flow_test.rs @@ -46,7 +46,7 @@ fn build_providers() -> Test { #[test] #[cfg(not(windows))] fn providers_smoke_test() { - use std::env; + use std::{env, time::Duration}; if env::var("RUNNER_OS").unwrap_or_default() == "macOS" { return; @@ -58,6 +58,9 @@ fn providers_smoke_test() { let user = "linus"; let password = "torvalds123"; let vault_server: VaultServer = instance.server(); + // banner is not enough for vault, we have to wait for the image to stabilize + tokio::time::sleep(Duration::from_secs(2)).await; + let localstack_server: LocalStackServer = instance.server(); fs::write( diff --git a/teller-providers/src/providers/hashicorp_consul.rs b/teller-providers/src/providers/hashicorp_consul.rs index 9fdafe8e..ad5019c0 100644 --- a/teller-providers/src/providers/hashicorp_consul.rs +++ b/teller-providers/src/providers/hashicorp_consul.rs @@ -285,6 +285,8 @@ mod tests { #[test] #[cfg(not(windows))] fn sanity_test() { + use std::time::Duration; + if env::var("RUNNER_OS").unwrap_or_default() == "macOS" { return; } @@ -304,6 +306,9 @@ mod tests { "address": server.external_url(), }); + // banner is not enough, we have to wait for the image to stabilize + tokio::time::sleep(Duration::from_secs(2)).await; + let p = Box::new( super::HashiCorpConsul::new( "hashicorp_consul", diff --git a/teller-providers/src/providers/hashicorp_vault.rs b/teller-providers/src/providers/hashicorp_vault.rs index c1d90fc3..a4e8ef89 100644 --- a/teller-providers/src/providers/hashicorp_vault.rs +++ b/teller-providers/src/providers/hashicorp_vault.rs @@ -98,6 +98,7 @@ fn parse_path(pm: &PathMap) -> Result<(&str, &str, &str)> { } fn xerr(pm: &PathMap, e: ClientError) -> Error { + println!("{e:?}"); match e { ClientError::RestClientError { source } => match source { rustify::errors::ClientError::ServerResponseError { code, content } => { @@ -275,17 +276,16 @@ mod tests { use super::*; use crate::providers::test_utils; - const PORT: u32 = 9200; - #[test] #[cfg(not(windows))] fn sanity_test() { + use std::time::Duration; + if env::var("RUNNER_OS").unwrap_or_default() == "macOS" { return; } let config = VaultServerConfig::builder() - .port(PORT) .version("1.8.2".into()) .build() .unwrap(); @@ -300,6 +300,9 @@ mod tests { "token": server.token }); + // banner is not enough, we have to wait for the image to stabilize + tokio::time::sleep(Duration::from_secs(2)).await; + let p = Box::new( super::Hashivault::new( "hashicorp_vault", diff --git a/teller-providers/src/providers/test_utils.rs b/teller-providers/src/providers/test_utils.rs index 83e92556..0b9f6054 100644 --- a/teller-providers/src/providers/test_utils.rs +++ b/teller-providers/src/providers/test_utils.rs @@ -149,6 +149,7 @@ impl ProviderTest { for (root_path, keys) in path_tree { let path_map = PathMap::from_path(&self.get_key_path(root_path)); let res = self.provider.as_ref().put(&path_map, keys).await; + println!("{res:?}"); assert!(res.is_ok()); assert_debug_snapshot!(format!("[put-{}]", root_path.replace('/', "_"),), res); }