Skip to content

Commit 4334655

Browse files
[Storage] Another fix to flaky retry test (Azure#25940)
1 parent 55a2a17 commit 4334655

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sdk/storage/azure-storage-blob/tests/test_retry.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ def test_retry_on_socket_timeout(self, **kwargs):
167167
assert 'read timeout' in str(error.value.args[0]), 'Expected socket timeout but got different exception.'
168168

169169
finally:
170-
# we must make the timeout normal again to let the delete operation succeed
171-
service.delete_container(container_name, connection_timeout=(11, 11))
170+
# Recreate client with normal timeouts
171+
service = self._create_storage_service(BlobServiceClient, storage_account_name, storage_account_key)
172+
service.delete_container(container_name)
172173

173174
@BlobPreparer()
174175
@recorded_by_proxy

sdk/storage/azure-storage-blob/tests/test_retry_async.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ async def test_retry_on_socket_timeout(self, **kwargs):
165165
assert 'Timeout on reading data from socket' in str(error.value.args[0]), 'Expected socket timeout but got different exception.'
166166

167167
finally:
168-
# we must make the timeout normal again to let the delete operation succeed
169-
await service.delete_container(container_name, connection_timeout=11, read_timeout=11)
168+
# Recreate client with normal timeouts
169+
service = self._create_storage_service(BlobServiceClient, storage_account_name, storage_account_key)
170+
service.delete_container(container_name)
170171

171172
@BlobPreparer()
172173
@recorded_by_proxy_async

0 commit comments

Comments
 (0)