Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run locust with 1 concurrent users on 3 Locust clients exit without warnings/errors #989

Closed
ztou opened this issue Apr 3, 2019 · 3 comments

Comments

@ztou
Copy link

ztou commented Apr 3, 2019

Description of issue

when there are 3 locust clients, but run with only 1 concurrent Locust users, locust exit without error or warning.

num_locusts = int(round(amount * percent))

num_locusts could be 0

Expected behavior

num_locusts should be at least 1

Actual behavior

num_locusts is 0

Steps to reproduce (for bug reports)

when there are 3 locust clients, but run with only 1 concurrent Locust users like below, locust exit without error or warning.

locust -f l.py --host=http://127.0.0.1:5000 --no-web -c 1 -r 1

l.py as below:

class T1(TaskSet):
    @task
    def test1(self):
        self.client.get("/test1")

class T2(TaskSet):
    @task
    def test2(self):
        self.client.get("/test2")

class T3(TaskSet):
    @task
    def test3(self):
        self.client.get("/test3")

class User1(HttpLocust):
    task_set = T1

class User2(HttpLocust):
    task_set = T2

class User3(HttpLocust):
    task_set = T3
ztou added a commit to ztou/locust that referenced this issue Apr 3, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
When running locust with -c 1 on 3 locust clients, locust exit sliently.

Not sure about the original design, so just add a simple fix to set
num_locusts to 1 when it was 0 on round()

ISSUE - locustio#989
ztou added a commit to ztou/locust that referenced this issue Apr 3, 2019
When running locust with -c 1 on 3 locust clients, locust exit silently.

Not sure about the original design, so just add a simple fix to set
num_locusts to 1 when it was 0 on round()

ISSUE - locustio#989
@ztou
Copy link
Author

ztou commented Apr 3, 2019

add a simple fix for your reference - #990

@delulu
Copy link
Contributor

delulu commented Apr 30, 2019

you haven't consider the situation where zero locust is spawn, so there's one test failure test_spawn_zero_locusts.

@heyman
Copy link
Member

heyman commented Oct 22, 2019

I believe this was fixed by #1113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants