Skip to content

Commit

Permalink
[Storage] Another fix to flaky retry test (Azure#25940)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalauzon-msft authored and mccoyp committed Sep 22, 2022
1 parent 297bd17 commit 7565cca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sdk/storage/azure-storage-blob/tests/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ def test_retry_on_socket_timeout(self, **kwargs):
assert 'read timeout' in str(error.value.args[0]), 'Expected socket timeout but got different exception.'

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

@BlobPreparer()
@recorded_by_proxy
Expand Down
5 changes: 3 additions & 2 deletions sdk/storage/azure-storage-blob/tests/test_retry_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ async def test_retry_on_socket_timeout(self, **kwargs):
assert 'Timeout on reading data from socket' in str(error.value.args[0]), 'Expected socket timeout but got different exception.'

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

@BlobPreparer()
@recorded_by_proxy_async
Expand Down

0 comments on commit 7565cca

Please sign in to comment.