From ca6660282df4c909a92451311542413d4b3a25dd Mon Sep 17 00:00:00 2001 From: Evgeniy Zayats Date: Wed, 23 Oct 2024 10:46:00 -0400 Subject: [PATCH] env: handle error during s3 gw deployment On macos it takes a little longer for s3 gw to start. Signed-off-by: Evgeniy Zayats --- neofs-testlib/neofs_testlib/env/env.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/neofs-testlib/neofs_testlib/env/env.py b/neofs-testlib/neofs_testlib/env/env.py index 6fcf2e757..e58eb2165 100644 --- a/neofs-testlib/neofs_testlib/env/env.py +++ b/neofs-testlib/neofs_testlib/env/env.py @@ -1110,7 +1110,13 @@ def start(self, fresh=True): self._generate_config() logger.info(f"Launching S3 GW: {self}") self._launch_process() - self._wait_until_ready() + try: + self._wait_until_ready() + except Exception as e: + allure.attach.file(self.stderr, name="s3 gw stderr", extension="txt") + allure.attach.file(self.stdout, name="s3 gw stdout", extension="txt") + allure.attach.file(self.config_path, name="s3 gw config", extension="txt") + raise e @allure.step("Stop s3 gw") def stop(self): @@ -1119,7 +1125,7 @@ def stop(self): self.process.wait() self.process = None - @retry(wait=wait_fixed(10), stop=stop_after_attempt(2), reraise=True) + @retry(wait=wait_fixed(10), stop=stop_after_attempt(10), reraise=True) def _wait_until_ready(self): endpoint = f"https://{self.address}" if self.tls_enabled else f"http://{self.address}" resp = requests.get(endpoint, verify=False)