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
I am running two client classes inside of a locust file. When I run with --no-web -c 1 -r 1 for testing purposes, the runner was not starting and showing this in the logs:
[2018-12-17 14:40:38,640] ubuntu/INFO/locust.runners: Hatching and swarming 0 clients at the rate 1 clients/s...
[2018-12-17 14:40:38,640] ubuntu/INFO/locust.runners: All locusts hatched: ScenarioPOSTGET: 0, ScenarioPOSTPUTGET: 0
[2018-12-17 17:11:35,855] ubuntu/INFO/locust.runners: All locusts dead
The problem is in runners.py.weight_locusts.py; lines 82 & 83 (see below)
defweight_locusts(self, amount, stop_timeout=None):
""" Distributes the amount of locusts for each WebLocust-class according to it's weight returns a list "bucket" with the weighted locusts """bucket= []
weight_sum=sum((locust.weightforlocustinself.locust_classesiflocust.task_set))
forlocustinself.locust_classes:
ifnotlocust.task_set:
warnings.warn("Notice: Found Locust class (%s) got no task_set. Skipping..."%locust.__name__)
continueifself.hostisnotNone:
locust.host=self.hostifstop_timeoutisnotNone:
locust.stop_timeout=stop_timeout# create locusts depending on weightpercent=locust.weight/float(weight_sum) # this is 0.5num_locusts=int(round(amount*percent)) # round of 0.5 is -> '0' :(bucket.extend([locustforxinxrange(0, num_locusts)])
returnbucket
Recommend using math.ceil if percent < 1
Expected behavior
The runner should execute my 2 scenarios in this situation.
Description of issue / feature request
I am running two client classes inside of a locust file. When I run with --no-web -c 1 -r 1 for testing purposes, the runner was not starting and showing this in the logs:
[2018-12-17 14:40:38,640] ubuntu/INFO/locust.runners: Hatching and swarming 0 clients at the rate 1 clients/s...
[2018-12-17 14:40:38,640] ubuntu/INFO/locust.runners: All locusts hatched: ScenarioPOSTGET: 0, ScenarioPOSTPUTGET: 0
[2018-12-17 17:11:35,855] ubuntu/INFO/locust.runners: All locusts dead
The problem is in runners.py.weight_locusts.py; lines 82 & 83 (see below)
Recommend using math.ceil if percent < 1
Expected behavior
The runner should execute my 2 scenarios in this situation.
Actual behavior
It does not and shows the locusts are dead.
Environment settings (for bug reports)
Steps to reproduce (for bug reports)
e.g.
Run this way:
locust -f locust_test.py --no-web -c 1 -r 1 --run-time 8s
The text was updated successfully, but these errors were encountered: