Skip to content

Commit

Permalink
env: handle error during s3 gw deployment
Browse files Browse the repository at this point in the history
On macos it takes a little longer for s3 gw to start.

Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
  • Loading branch information
Evgeniy Zayats committed Oct 28, 2024
1 parent a524385 commit ca66602
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions neofs-testlib/neofs_testlib/env/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit ca66602

Please sign in to comment.