summaryrefslogtreecommitdiff
path: root/service/test/perf
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-08-20 15:59:01 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-08-20 16:01:54 -0300
commit3bef40f5c66265a1179905f075c62c2ca42e4e4d (patch)
tree92a7cf685989fd82a3a4f00991872053d6a17073 /service/test/perf
parentfd9766ea54416b331d0ef34bf9426f37315aefe3 (diff)
[tests] fixes test_Contacts performance
Missing crochet code to start new deferred web client.
Diffstat (limited to 'service/test/perf')
-rw-r--r--service/test/perf/contacts/test_Contacts.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/service/test/perf/contacts/test_Contacts.py b/service/test/perf/contacts/test_Contacts.py
index 8bfb898d..5dd56a6c 100644
--- a/service/test/perf/contacts/test_Contacts.py
+++ b/service/test/perf/contacts/test_Contacts.py
@@ -14,22 +14,37 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
import unittest
+import logging
from funkload.FunkLoadTestCase import FunkLoadTestCase
from test.support.integration import AppTestClient
+from test.support.dispatcher.proxy import Proxy
+from crochet import setup, wait_for
+setup()
+from leap.common.events.server import ensure_server
+
+
+@wait_for(timeout=5.0)
+def start_app_test_client(client):
+ ensure_server()
+ return client.start_client()
class Contacts(FunkLoadTestCase):
def setUpBench(self):
+ logging.disable('INFO')
client = AppTestClient()
+ start_app_test_client(client)
+ client.listenTCP()
+ proxy = Proxy(proxy_port='8889', app_port='4567')
# setup data
client.add_multiple_to_mailbox(10, 'INBOX', to='to@inbox.com', cc='cc@inbox.com', bcc='bcc@inbox.com')
client.add_multiple_to_mailbox(10, 'TRASH', to='to@trash.com', cc='cc@trash.com', bcc='bcc@trash.com')
client.add_multiple_to_mailbox(10, 'DRAFTS', to='to@drafts.com', cc='cc@drafts.com', bcc='bcc@drafts.com')
- self.call_to_terminate = client.run_on_a_thread(logfile='results/app.log')
+ self.call_to_terminate = proxy.run_on_a_thread()
def tearDownBench(self):
self.call_to_terminate()