diff options
author | Victor Shyba <victor1984@riseup.net> | 2016-11-29 02:04:57 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-12-12 09:17:51 -0200 |
commit | 67917656589d08a84f98ff675f6aeade809e1faf (patch) | |
tree | 2528862968091a3eb8b18fb0b9e4329777135e5c /testing/tests | |
parent | dc80d2b59edd14ab463dc74e5fa19d1a04c27ca1 (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.py | 5 |
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): |