diff options
author | drebs <drebs@riseup.net> | 2017-10-04 15:42:29 -0300 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2017-10-05 09:43:40 -0300 |
commit | 64a08c836374bceb6e3d0813fb918dfd3f570852 (patch) | |
tree | 0e62c0d8d9d8df70a4eb9245902e4fe04cdeb55c /tests | |
parent | 7ce706979c7f4d7bac4c26c026c6573b0c61bba3 (diff) |
[bug] ensure maximum concurrency on blobs transfer
The way in that concurrency limit was being enforced was such that
transfer attempts were being spawned in groups of 3, and all of them had
to finish before a new group could be spawned. This modification allows
for use of maximum concurrency level at all times.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/blobs/test_blob_manager.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/blobs/test_blob_manager.py b/tests/blobs/test_blob_manager.py index 81379c73..c6f84e29 100644 --- a/tests/blobs/test_blob_manager.py +++ b/tests/blobs/test_blob_manager.py @@ -19,6 +19,7 @@ Tests for BlobManager. """ from twisted.trial import unittest from twisted.internet import defer +from twisted.web.error import SchemeNotSupported from leap.soledad.client._db.blobs import BlobManager, BlobDoc, FIXED_REV from leap.soledad.client._db.blobs import BlobAlreadyExistsError from leap.soledad.client._db.blobs import SyncStatus @@ -154,7 +155,8 @@ class BlobManagerTestCase(unittest.TestCase): self.manager._encrypt_and_upload = Mock(return_value=upload_failure) content, blob_id = "Blob content", uuid4().hex doc1 = BlobDoc(BytesIO(content), blob_id) - with pytest.raises(Exception): + with pytest.raises(SchemeNotSupported): + # should fail because manager URL is invalid yield self.manager.put(doc1, len(content)) pending_upload = SyncStatus.PENDING_UPLOAD local_list = yield self.manager.local_list(sync_status=pending_upload) @@ -166,7 +168,8 @@ class BlobManagerTestCase(unittest.TestCase): self.manager.remote_list = Mock(return_value=[]) content, blob_id = "Blob content", uuid4().hex doc1 = BlobDoc(BytesIO(content), blob_id) - with pytest.raises(Exception): + with pytest.raises(SchemeNotSupported): + # should fail because manager URL is invalid yield self.manager.put(doc1, len(content)) for _ in range(self.manager.max_retries + 1): with pytest.raises(defer.FirstError): |