You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
on_request_xxx() checks exiting condition before incrementing the relevant variables; this should be done in the reverse order.
A test run exits upon StopLocust exception is raised. The condition is checked every time a request is sent and responded (or failed). However the condition checking looks at the wrong number; for example, in on_request_success() in stats.py
def on_request_success(request_type, name, response_time, response_length):
if global_stats.max_requests is not None and (global_stats.num_requests + global_stats.num_failures) >= global_stats.max_requests:
raise StopLocust("Maximum number of requests reached")
global_stats.get(name, request_type).log(response_time, response_length)
global_stats.num_requests is increased by one in the log() function after the condition is checked. This leads to sending one more requests than being asked to.
Was wondering if this design is intended? or?
The text was updated successfully, but these errors were encountered:
on_request_xxx()
checks exiting condition before incrementing the relevant variables; this should be done in the reverse order.A test run exits upon
StopLocust
exception is raised. The condition is checked every time a request is sent and responded (or failed). However the condition checking looks at the wrong number; for example, inon_request_success()
in stats.pyglobal_stats.num_requests
is increased by one in thelog()
function after the condition is checked. This leads to sending one more requests than being asked to.Was wondering if this design is intended? or?
The text was updated successfully, but these errors were encountered: