summaryrefslogtreecommitdiff
path: root/testing/tests/perf/test_encdecpool.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-09-19 22:00:04 -0400
committerdrebs <drebs@leap.se>2016-12-12 09:11:59 -0200
commit0098849ffd6d9d7514a2eff7b6ced9403a9062ca (patch)
treeff39cdd1b152d9b6451e1ca0ffb04a938d199602 /testing/tests/perf/test_encdecpool.py
parentd7740272be029db6229ec5372f277d2934815e98 (diff)
[refactor] add SoledadCrypto interface
Diffstat (limited to 'testing/tests/perf/test_encdecpool.py')
-rw-r--r--testing/tests/perf/test_encdecpool.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/testing/tests/perf/test_encdecpool.py b/testing/tests/perf/test_encdecpool.py
deleted file mode 100644
index 8e820b9c..00000000
--- a/testing/tests/perf/test_encdecpool.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import pytest
-import json
-from uuid import uuid4
-from twisted.internet.defer import gatherResults
-from leap.soledad.client.encdecpool import SyncEncrypterPool
-from leap.soledad.common.document import SoledadDocument
-# FIXME: test load is low due issue #7370, higher values will get out of memory
-
-
-def create_encrypt(amount, size):
- @pytest.mark.benchmark(group="test_pool_encrypt")
- @pytest.inlineCallbacks
- def test(soledad_client, txbenchmark_with_setup, request, payload):
- DOC_CONTENT = {'payload': payload(size)}
-
- def setup():
- client = soledad_client()
- pool = SyncEncrypterPool(client._crypto, client._sync_db)
- pool.start()
- request.addfinalizer(pool.stop)
- docs = [
- SoledadDocument(doc_id=uuid4().hex, rev='rev',
- json=json.dumps(DOC_CONTENT))
- for _ in xrange(amount)
- ]
- return pool, docs
-
- @pytest.inlineCallbacks
- def put_and_wait(pool, docs):
- yield gatherResults([pool.encrypt_doc(doc) for doc in docs])
-
- yield txbenchmark_with_setup(setup, put_and_wait)
- return test
-
-test_encdecpool_encrypt_100_10k = create_encrypt(100, 10*1000)
-test_encdecpool_encrypt_100_100k = create_encrypt(100, 100*1000)
-test_encdecpool_encrypt_100_500k = create_encrypt(100, 500*1000)