Skip to content

Commit

Permalink
[Storage] Fix flaky test in test_file.py migration (#26735)
Browse files Browse the repository at this point in the history
* Be gone flaky test

* Live only tag

* Default variable empty pop
  • Loading branch information
vincenttran-msft authored Oct 10, 2022
1 parent cb2c5b7 commit d958d6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 528 deletions.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions sdk/storage/azure-storage-file-share/tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1660,16 +1660,16 @@ def test_copy_file_async_private_file_with_sas(self, **kwargs):
actual_data = file_client.download_file().readall()
assert actual_data == data

@pytest.mark.live_test_only
@FileSharePreparer()
@recorded_by_proxy
def test_abort_copy_file(self, **kwargs):
storage_account_name = kwargs.pop("storage_account_name")
storage_account_key = kwargs.pop("storage_account_key")
secondary_storage_account_name = kwargs.pop("secondary_storage_account_name")
secondary_storage_account_key = kwargs.pop("secondary_storage_account_key")

self._setup(storage_account_name, storage_account_key, secondary_storage_account_name, secondary_storage_account_key)
data = b'12345678' * 1024 * 256
data = b'12345678' * 1024 * 1024
self._create_remote_share()
source_file = self._create_remote_file(file_data=data)
sas_token = self.generate_sas(
Expand Down Expand Up @@ -2352,7 +2352,7 @@ def test_sas_access_file(self, **kwargs):
def test_sas_signed_identifier(self, **kwargs):
storage_account_name = kwargs.pop("storage_account_name")
storage_account_key = kwargs.pop("storage_account_key")
variables = kwargs.pop("variables")
variables = kwargs.pop('variables', {})

self._setup(storage_account_name, storage_account_key)
file_client = self._create_file()
Expand Down
6 changes: 3 additions & 3 deletions sdk/storage/azure-storage-file-share/tests/test_file_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,16 +1685,16 @@ async def test_copy_file_async_private_file_with_sas_async(self, **kwargs):
actual_data = await content.readall()
assert actual_data == data

@pytest.mark.live_test_only
@FileSharePreparer()
@recorded_by_proxy_async
async def test_abort_copy_file_async(self, **kwargs):
storage_account_name = kwargs.pop("storage_account_name")
storage_account_key = kwargs.pop("storage_account_key")
secondary_storage_account_name = kwargs.pop("secondary_storage_account_name")
secondary_storage_account_key = kwargs.pop("secondary_storage_account_key")

self._setup(storage_account_name, storage_account_key, secondary_storage_account_name, secondary_storage_account_key)
data = b'12345678' * 1024 * 256
data = b'12345678' * 1024 * 1024
await self._setup_share(storage_account_name, storage_account_key)
await self._create_remote_share()
source_file = await self._create_remote_file(file_data=data)
Expand Down Expand Up @@ -2406,7 +2406,7 @@ async def test_sas_access_file(self, **kwargs):
async def test_sas_signed_identifier(self, **kwargs):
storage_account_name = kwargs.pop("storage_account_name")
storage_account_key = kwargs.pop("storage_account_key")
variables = kwargs.pop("variables")
variables = kwargs.pop('variables', {})

self._setup(storage_account_name, storage_account_key)
file_client = await self._create_file(storage_account_name, storage_account_key)
Expand Down

0 comments on commit d958d6b

Please sign in to comment.