Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 00eb8b5

Browse files
committed
revises retry deadline to accommodate the timeout.
1 parent 2544afb commit 00eb8b5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/unit/test_client_retry.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
PROJECT = "test-project"
2525

26+
# A deadline > 1.0s is required because the default retry (google.api_core.retry.Retry)
27+
# has an initial delay of 1.0s. If the deadline is <= 1.0s, the first retry attempt
28+
# (scheduled for now + 1.0s) will be rejected immediately as exceeding the deadline.
29+
_RETRY_DEADLINE = 10.0
30+
2631

2732
def _make_credentials():
2833
import google.auth.credentials
@@ -83,7 +88,7 @@ def test_call_api_applying_custom_retry_on_timeout(global_time_lock):
8388
"api_request",
8489
side_effect=[TimeoutError, "result"],
8590
)
86-
retry = DEFAULT_RETRY.with_deadline(1).with_predicate(
91+
retry = DEFAULT_RETRY.with_deadline(_RETRY_DEADLINE).with_predicate(
8792
lambda exc: isinstance(exc, TimeoutError)
8893
)
8994

0 commit comments

Comments
 (0)