summaryrefslogtreecommitdiff
path: root/testing/tests
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-29 02:04:57 -0300
committerVictor Shyba <victor1984@riseup.net>2016-11-29 02:04:57 -0300
commit91870566bbfc642d43e927ea714192b9962f7a7f (patch)
tree9841ea4a1823fc893763dbe91ede8e010fd65094 /testing/tests
parentaecd9f068300fdf31a096b24385e163636d187f6 (diff)
[feature] speed up sync benchmark setup code
We aren't testing huge payloads on CI, so it doesn't make sense to insert docs one by one. 'gatherResults' can speed up bench setup.
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/benchmarks/test_sync.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/testing/tests/benchmarks/test_sync.py b/testing/tests/benchmarks/test_sync.py
index 1bf6cc21..1501d74b 100644
--- a/testing/tests/benchmarks/test_sync.py
+++ b/testing/tests/benchmarks/test_sync.py
@@ -1,11 +1,14 @@
import pytest
+from twisted.internet.defer import gatherResults
@pytest.inlineCallbacks
def load_up(client, amount, payload):
# create a bunch of local documents
+ deferreds = []
for i in xrange(amount):
- yield client.create_doc({'content': payload})
+ deferreds.append(client.create_doc({'content': payload}))
+ yield gatherResults(deferreds)
def create_upload(uploads, size):