From 2d45c560e853cacdfb2d3dd1d8ba2ad19cdda3ab Mon Sep 17 00:00:00 2001 From: Tomer Nosrati Date: Fri, 20 Sep 2024 20:15:29 +0300 Subject: [PATCH] Fixed IndexError when accessing the container port info --- src/pytest_celery/api/container.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pytest_celery/api/container.py b/src/pytest_celery/api/container.py index fa08186a..600a8175 100644 --- a/src/pytest_celery/api/container.py +++ b/src/pytest_celery/api/container.py @@ -98,6 +98,12 @@ def ready_prompt(self) -> str | None: """ return None + @retry( + stop=stop_after_attempt(3), + wait=wait_fixed(3), + retry=retry_if_exception_type(IndexError), + reraise=True, + ) def _wait_port(self, port: str) -> int: """Blocks until the specified port is ready.