From 8eecd0be5f95a24f1d9d7c5618e3dfd677ff19e1 Mon Sep 17 00:00:00 2001 From: WieslerAA <166396688+WieslerAA@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:52:38 +0200 Subject: [PATCH] Make api retries configurable via env variable (#184) Make api retries configurable via env variable --- tests/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/common.py b/tests/common.py index d92347b..6a30287 100644 --- a/tests/common.py +++ b/tests/common.py @@ -11,8 +11,8 @@ def sync_client() -> Client: return Client( token=get_env_var("TEST_TOKEN"), host=get_env_var("TEST_API_URL"), - # This will retry after [0.0, 0.5, 1.0, 2.0, 4.0] seconds - total_retries=5, + # This will retry after [0.0, 0.25, 0.5, 1.0, 2.0] seconds + total_retries=int(os.environ.get("TEST_API_RETRIES", "5")), ) @@ -21,8 +21,8 @@ async def async_client() -> AsyncIterable[AsyncClient]: async with AsyncClient( token=get_env_var("TEST_TOKEN"), host=get_env_var("TEST_API_URL"), - # This will retry after [0.0, 0.5, 1.0, 2.0, 4.0] seconds - total_retries=5, + # This will retry after [0.0, 0.25, 0.5, 1.0, 2.0] seconds + total_retries=int(os.environ.get("TEST_API_RETRIES", "5")), ) as client: yield client