From 349e42d73225282935b2d4677e778821db25634b Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 28 Oct 2016 21:37:56 -0300 Subject: [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. --- testing/tests/perf/test_sync.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'testing/tests/perf') 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): -- cgit v1.2.3