I have written a simple load test using Locust (http://locust.io).
Now I noticed that sometimes (using a higher load) the response I get from a post call has a status_code of 0 and a None
content. The 0 status code is not automatically recognized as a failure in Locust, so I have to test it manually.
My code fragment is this:
with self.client.get(path, catch_response=True) as response:
if response.status_code != 200:
response.failure(path + ": returned " + str(response.status_code))
elif check not in response.content:
response.failure(path + ": wrong response, missing '" + check + "'")
Note: check
is a variable for a part of the expected response content.
The question is: is this a expected behaviour? Is this a problem of Locust (or Python) or is this a fault in the tested application?