Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/postgres/testcontainers/postgres/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def __init__(
self.driver = f"+{driver}" if driver else ""

self.with_exposed_ports(self.port)
self.waiting_for(
LogMessageWaitStrategy(
'database system is ready to accept connections').with_startup_timeout(10)
)


def _configure(self) -> None:
self.with_env("POSTGRES_USER", self.username)
Expand All @@ -87,7 +92,6 @@ def get_connection_url(self, host: Optional[str] = None, driver: Optional[str] =
port=self.port,
)

@wait_container_is_ready()
def _connect(self) -> None:
escaped_single_password = self.password.replace("'", "'\"'\"'")
result = self.exec(
Expand Down
Loading