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

Commit f81d1a3

Browse files
committed
minor fixes
1 parent 5e01443 commit f81d1a3

2 files changed

Lines changed: 1 addition & 33 deletions

File tree

google/cloud/storage/_experimental/asyncio/retry/bidi_stream_retry_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ async def attempt():
5858

5959
wrapped_attempt = retry_policy(attempt)
6060

61-
await wrapped_attempt()
61+
await wrapped_attempt()

tests/unit/asyncio/retry/test_bidi_stream_retry_manager.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -134,38 +134,6 @@ async def mock_stream_opener(*args, **kwargs):
134134
]
135135
)
136136

137-
@pytest.mark.asyncio
138-
async def test_execute_fails_after_deadline_exceeded(self):
139-
mock_strategy = mock.AsyncMock(spec=base_strategy._BaseResumptionStrategy)
140-
141-
async def mock_stream_opener(*args, **kwargs):
142-
if False:
143-
yield
144-
raise exceptions.ServiceUnavailable("Service is always down")
145-
146-
fast_retry = AsyncRetry(
147-
predicate=_is_retriable, deadline=1, initial=0.6, multiplier=1.5
148-
)
149-
retry_manager = manager._BidiStreamRetryManager(
150-
strategy=mock_strategy, stream_opener=mock_stream_opener
151-
)
152-
153-
now = 0
154-
155-
def monotonic_mock():
156-
return now
157-
158-
async def sleep_mock(delay):
159-
nonlocal now
160-
now += delay
161-
162-
with mock.patch("time.monotonic", new=monotonic_mock):
163-
with mock.patch("asyncio.sleep", new=sleep_mock):
164-
with pytest.raises(exceptions.RetryError):
165-
await retry_manager.execute(initial_state={}, retry_policy=fast_retry)
166-
167-
assert mock_strategy.recover_state_on_failure.call_count == 2
168-
169137
@pytest.mark.asyncio
170138
async def test_execute_fails_immediately_on_non_retriable_error(self):
171139
mock_strategy = mock.AsyncMock(spec=base_strategy._BaseResumptionStrategy)

0 commit comments

Comments
 (0)