summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-10-28 21:37:56 -0300
committerVictor Shyba <victor1984@riseup.net>2016-11-18 15:55:52 -0300
commit5054871732d44b59865658504f9d41962362c22d (patch)
tree39032ba00a133a75990ce31775df41b883b21033 /testing
parent55312af204e985f89463105d4aac1c9e63846479 (diff)
[tests] improve doc creation on benchmarks
If we create all at once we cant test higher loads because it will try to hold all in memory at the same time. Also, this code is smaller and more readable.
Diffstat (limited to 'testing')
-rw-r--r--testing/tests/perf/test_sync.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/testing/tests/perf/test_sync.py b/testing/tests/perf/test_sync.py
index 0b48a0b9..7b3c4bf0 100644
--- a/testing/tests/perf/test_sync.py
+++ b/testing/tests/perf/test_sync.py
@@ -1,17 +1,11 @@
import pytest
-from twisted.internet.defer import gatherResults
-
+@pytest.inlineCallbacks
def load_up(client, amount, payload):
- deferreds = []
# create a bunch of local documents
for i in xrange(amount):
- d = client.create_doc({'content': payload})
- deferreds.append(d)
- d = gatherResults(deferreds)
- d.addCallback(lambda _: None)
- return d
+ yield client.create_doc({'content': payload})
def create_upload(uploads, size):