From 4de2f6ceecaade43188f92d3d12c7e2b4da0f8de Mon Sep 17 00:00:00 2001 From: Sergei Tsaplin Date: Wed, 13 Nov 2024 16:05:10 +0100 Subject: [PATCH] Fix Vault health check --- modules/vault/testcontainers/vault/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/vault/testcontainers/vault/__init__.py b/modules/vault/testcontainers/vault/__init__.py index 5f50cdd4e..c89b27ea5 100644 --- a/modules/vault/testcontainers/vault/__init__.py +++ b/modules/vault/testcontainers/vault/__init__.py @@ -12,6 +12,7 @@ # under the License. from http.client import HTTPException +from urllib.error import URLError from urllib.request import urlopen from testcontainers.core.container import DockerContainer @@ -61,7 +62,7 @@ def get_connection_url(self) -> str: exposed_port = self.get_exposed_port(self.port) return f"http://{host_ip}:{exposed_port}" - @wait_container_is_ready(HTTPException) + @wait_container_is_ready(HTTPException, URLError) def _healthcheck(self) -> None: url = f"{self.get_connection_url()}/v1/sys/health" with urlopen(url) as res: