Skip to content

Commit e88975e

Browse files
committed
fix: keep original _is_transient_error name, remove AssertionError from retryable
1 parent 45e8c4d commit e88975e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ def wait_for_task(client, task_id, timeout_ms=10000, poll_interval_ms=1000):
4747
time.sleep(poll_interval_ms / 1000.0)
4848

4949

50-
def _is_retryable_error(exc: Exception) -> bool:
50+
def _is_transient_error(exc: Exception) -> bool:
5151
"""Check if an exception is worth retrying with backoff."""
5252
if isinstance(exc, (httpx.ReadTimeout, httpx.ConnectTimeout, httpx.ConnectError)):
5353
return True
54-
if isinstance(exc, AssertionError):
55-
return True
5654
if isinstance(exc, StreamAPIException):
5755
if exc.status_code in (429, 502, 503, 504):
5856
return True
@@ -91,7 +89,7 @@ def wrapper(*args, **kwargs):
9189
try:
9290
return func(*args, **kwargs)
9391
except Exception as exc:
94-
if attempt < max_retries and _is_retryable_error(exc):
92+
if attempt < max_retries and _is_transient_error(exc):
9593
last_exc = exc
9694
delay = min(base_delay * (2**attempt), max_delay)
9795
time.sleep(delay)

0 commit comments

Comments
 (0)