From e376b0d3f13e57750c3802100e30e02228e22603 Mon Sep 17 00:00:00 2001 From: Thais Siqueira Date: Tue, 22 Mar 2016 15:25:39 -0300 Subject: Adds changes to run load test on current version. --- service/test/load/locustfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'service') diff --git a/service/test/load/locustfile.py b/service/test/load/locustfile.py index 0c2ed518..69a545ed 100644 --- a/service/test/load/locustfile.py +++ b/service/test/load/locustfile.py @@ -54,10 +54,11 @@ class UserBehavior(TaskSet): response = self.client.post( "/%s" % LoginResource.BASE_URL, {"username": username, "password": password}, - verify=False) + verify=False, + cookies=self.cookies) self.cookies.update(response.cookies.get_dict()) - resp = self.client.get("/", verify=False) - self.cookies.update(resp.cookies.get_dict()) + #resp = self.client.get("/", verify=False) + #self.cookies.update(resp.cookies.get_dict()) self.username = username @task(1) @@ -83,7 +84,6 @@ class UserBehavior(TaskSet): self.cookies.update( self.client.get("/", verify=False).cookies.get_dict()) - print(self.cookies) with self.client.post( '/mails', json=payload, @@ -91,7 +91,7 @@ class UserBehavior(TaskSet): cookies=self.cookies, headers={ 'X-Requested-With': 'XMLHttpRequest', - 'X-XSRF-TOKEN': self.cookies['XSRF-TOKEN']}) as email_response: + 'X-XSRF-TOKEN': self.cookies.get('XSRF-TOKEN', '')}) as email_response: if email_response.status_code == 201: email_id = json.loads(email_response.content)['ident'] print email_id @@ -110,10 +110,10 @@ class UserBehavior(TaskSet): verify=False, headers={ 'X-Requested-With': 'XMLHttpRequest', - 'X-XSRF-TOKEN': self.cookies['XSRF-TOKEN']}) + 'X-XSRF-TOKEN': self.cookies.get('XSRF-TOKEN', '')}) class WebsiteUser(HttpLocust): task_set = UserBehavior - min_wait = 5000 - max_wait = 15000 + min_wait = 1000 + max_wait = 5000 -- cgit v1.2.3