Skip to content

Commit 27752ae

Browse files
committed
@pcrespov use time based max delay
1 parent cd02af2 commit 27752ae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

services/web/server/tests/unit/with_dbs/01/test_api_keys.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
)
2929
from simcore_service_webserver.application_settings import GarbageCollectorSettings
3030
from simcore_service_webserver.db.models import UserRole
31-
from tenacity import retry_if_exception_type, stop_after_attempt, wait_fixed
31+
from tenacity import (
32+
retry_if_exception_type,
33+
stop_after_attempt,
34+
stop_after_delay,
35+
wait_fixed,
36+
)
3237

3338

3439
@pytest.fixture
@@ -174,7 +179,7 @@ async def test_create_api_key_with_expiration(
174179
async for attempt in tenacity.AsyncRetrying(
175180
wait=wait_fixed(1),
176181
retry=retry_if_exception_type(AssertionError),
177-
stop=stop_after_attempt(5),
182+
stop=stop_after_delay(5 * expiration_interval.seconds),
178183
reraise=True,
179184
):
180185
with attempt:

0 commit comments

Comments
 (0)