Skip to content

Commit

Permalink
[Storage] Make lease duration tests less flakey (#24930)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalauzon-msft authored Jun 22, 2022
1 parent 0ea015b commit defa0c3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/tests/test_common_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ def test_lease_blob_with_duration(self, storage_account_name, storage_account_ke
blob = self.bsc.get_blob_client(self.container_name, blob_name)
lease = blob.acquire_lease(lease_duration=15)
resp = blob.upload_blob(b'hello 2', length=7, lease=lease)
self.sleep(15)
self.sleep(17)

# Assert
with self.assertRaises(HttpResponseError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ async def test_lease_blob_with_duration(self, storage_account_name, storage_acco
blob = self.bsc.get_blob_client(self.container_name, blob_name)
lease = await blob.acquire_lease(lease_duration=15)
resp = await blob.upload_blob(b'hello 2', length=7, lease=lease)
self.sleep(15)
self.sleep(17)

# Assert
with self.assertRaises(HttpResponseError):
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def test_lease_container_with_duration(self, storage_account_name, storage_accou
# Assert
with self.assertRaises(HttpResponseError):
container.acquire_lease()
self.sleep(15)
self.sleep(17)
container.acquire_lease()

@BlobPreparer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ async def test_lease_container_with_duration(self, storage_account_name, storage
# Assert
with self.assertRaises(HttpResponseError):
await container.acquire_lease()
self.sleep(15)
self.sleep(17)
await container.acquire_lease()

@BlobPreparer()
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-file-share/tests/test_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_lease_share_with_duration(self, storage_account_name, storage_account_k
# Assert
with self.assertRaises(HttpResponseError):
share_client.acquire_lease()
self.sleep(15)
self.sleep(17)
share_client.acquire_lease()

@FileSharePreparer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ async def test_lease_share_with_duration(self, storage_account_name, storage_acc
# Assert
with self.assertRaises(HttpResponseError):
await share_client.acquire_lease()
self.sleep(15)
self.sleep(17)
await share_client.acquire_lease()

@FileSharePreparer()
Expand Down

0 comments on commit defa0c3

Please sign in to comment.