summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-10-27 19:39:25 -0300
committerVictor Shyba <victor1984@riseup.net>2017-10-27 19:49:28 -0300
commit72956174187fa2fccbb060d04d4809797657e029 (patch)
tree658177e6bb96bce4d91b9901d032bda0fae2e195 /tests
parentf4ab4e15ba2fd6eb06bcd71e8fe04abc903d4ff0 (diff)
[bug] there is no retry limit for usual transfers
Retry limit was originally specified in #8825 as a protection mechanism, but #8822 (retry) doesn't specify a retry limit. In fact, blobs is supposed to retry until transfer is complete using timed delays between attempts, but never giving up. -- Related: #8822 -- Related: #8825
Diffstat (limited to 'tests')
-rw-r--r--tests/blobs/test_blob_manager.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/tests/blobs/test_blob_manager.py b/tests/blobs/test_blob_manager.py
index 4b2b1135..f1872ab1 100644
--- a/tests/blobs/test_blob_manager.py
+++ b/tests/blobs/test_blob_manager.py
@@ -23,7 +23,6 @@ from leap.soledad.client._document import BlobDoc
from leap.soledad.client._db.blobs import BlobManager, FIXED_REV
from leap.soledad.client._db.blobs import BlobAlreadyExistsError
from leap.soledad.client._db.blobs import SyncStatus
-from leap.soledad.client._db.blobs import RetriableTransferError
from io import BytesIO
from mock import Mock
from uuid import uuid4
@@ -169,50 +168,6 @@ class BlobManagerTestCase(unittest.TestCase):
@defer.inlineCallbacks
@pytest.mark.usefixtures("method_tmpdir")
- def test_upload_retry_limit(self):
- # prepare the manager to fail accordingly
- self.manager.remote_list = Mock(return_value=[])
- self.manager._encrypt_and_upload = Mock(
- side_effect=RetriableTransferError)
- # put a blob in local storage
- content, blob_id = "Blob content", uuid4().hex
- yield self.manager.local.put(blob_id, BytesIO(content), len(content))
- pending = SyncStatus.PENDING_UPLOAD
- yield self.manager.local.update_sync_status(blob_id, pending)
- # try to send missing
- with pytest.raises(defer.FirstError):
- yield self.manager.send_missing()
- # assert failed state and number of retries
- failed_upload = SyncStatus.FAILED_UPLOAD
- local_list = yield self.manager.local_list_status(failed_upload)
- self.assertIn(blob_id, local_list)
- sync_status, retries = \
- yield self.manager.local.get_sync_status(blob_id)
- self.assertEqual(failed_upload, sync_status)
- self.assertEqual(self.manager.max_retries, retries)
-
- @defer.inlineCallbacks
- @pytest.mark.usefixtures("method_tmpdir")
- def test_download_retry_limit(self):
- # prepare the manager to fail accordingly
- blob_id = uuid4().hex
- self.manager.local_list_status = Mock(return_value=[blob_id])
- self.manager._download_and_decrypt = Mock(
- side_effect=RetriableTransferError)
- # try to fetch missing
- with pytest.raises(defer.FirstError):
- yield self.manager.fetch_missing()
- # assert failed state and number of retries
- failed_download = SyncStatus.FAILED_DOWNLOAD
- local_list = yield self.manager.local.list_status(failed_download)
- self.assertIn(blob_id, local_list)
- sync_status, retries = \
- yield self.manager.local.get_sync_status(blob_id)
- self.assertEqual(failed_download, sync_status)
- self.assertEqual(self.manager.max_retries, retries)
-
- @defer.inlineCallbacks
- @pytest.mark.usefixtures("method_tmpdir")
def test_local_list_doesnt_include_unavailable_blobs(self):
local = self.manager.local
unavailable_ids, deferreds = [], []