Skip to content

Commit

Permalink
Add delay
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Aug 9, 2024
1 parent 123ecbd commit ca9c249
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/utils/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ use std::{
atomic::{AtomicU64, Ordering},
Arc,
},
time::Duration,
};
use testcontainers::{
core::logs::consumer::logging_consumer::LoggingConsumer, runners::AsyncRunner, ContainerAsync,
ImageExt,
};
use testcontainers_modules::{nats::Nats, postgres::Postgres};
use tokio::net::TcpListener;
use tokio::{net::TcpListener, time::sleep};
use tracing::level_filters::LevelFilter;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};

Expand Down Expand Up @@ -88,7 +89,9 @@ async fn setup_database() -> (ContainerAsync<Postgres>, DbConn) {
container.get_host_port_ipv4(5432).await.unwrap(),
);

tracing::debug!("Connecting to Postgres at {connection_string:?}");
sleep(Duration::from_secs(5)).await;

tracing::debug!("Connecting to Postgres at {:?}", connection_string);

let db = Database::connect(connection_string)
.await
Expand Down

0 comments on commit ca9c249

Please sign in to comment.