summaryrefslogtreecommitdiff
path: root/testing/tests/sync/test_encdecpool.py
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2016-08-25 19:04:18 -0300
committerVictor Shyba <victor.shyba@gmail.com>2016-08-25 19:12:31 -0300
commit49d4013819733966c05178254725e6a89f1909fe (patch)
treedd7c3e739735a90d6c1323bc5445fe271718c0e9 /testing/tests/sync/test_encdecpool.py
parent8e87fecc4f9262ee290c0a148cdbfb214cc0417d (diff)
[test] stop trying to hit me and hit me
TestSyncEncrypterPool.test_encrypt_doc_and_get_it_back was trying to do an operation and asserting the number of attempts. This test is about putting a doc on encrypter pool and getting it encrypted. If we dont wait for the encryption operation to succeed, then complex trial-and-error happens, but if we just ask twisted to wait for one operation before going to the other, this is not needed. -- Resolves: #8398
Diffstat (limited to 'testing/tests/sync/test_encdecpool.py')
-rw-r--r--testing/tests/sync/test_encdecpool.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/testing/tests/sync/test_encdecpool.py b/testing/tests/sync/test_encdecpool.py
index 0aa17682..4a32885e 100644
--- a/testing/tests/sync/test_encdecpool.py
+++ b/testing/tests/sync/test_encdecpool.py
@@ -64,17 +64,11 @@ class TestSyncEncrypterPool(BaseSoledadTest):
"""
doc = SoledadDocument(
doc_id=DOC_ID, rev=DOC_REV, json=json.dumps(DOC_CONTENT))
- self._pool.encrypt_doc(doc)
- # exhaustivelly attempt to get the encrypted document
- encrypted = None
- attempts = 0
- while encrypted is None and attempts < 10:
- encrypted = yield self._pool.get_encrypted_doc(DOC_ID, DOC_REV)
- attempts += 1
+ yield self._pool.encrypt_doc(doc)
+ encrypted = yield self._pool.get_encrypted_doc(DOC_ID, DOC_REV)
self.assertIsNotNone(encrypted)
- self.assertTrue(attempts < 10)
class TestSyncDecrypterPool(BaseSoledadTest):