summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-29 02:04:57 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:17:51 -0200
commit67917656589d08a84f98ff675f6aeade809e1faf (patch)
tree2528862968091a3eb8b18fb0b9e4329777135e5c
parentdc80d2b59edd14ab463dc74e5fa19d1a04c27ca1 (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.
-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):