summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-10-28 21:37:56 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:12:00 -0200
commit349e42d73225282935b2d4677e778821db25634b (patch)
tree9e2d77f85d287622e54d92e37ada703bc4f42f67
parent304739a5b7335a521c37680235bd3452cf3c8d0f (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.
-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):