locustio / locust

Write scalable load tests in plain Python 🚗💨
https://locust.cloud
MIT License
24.95k stars 2.99k forks source link

cannot specify task of UserClass when locust run on distributed mode #2657

Closed skyterra closed 7 months ago

skyterra commented 7 months ago

Prerequisites

Description

if launch locust with --processes argument, choosing task will not working.

image

Command line

locust --processes 2 --class-picker -f locustfiles

Locustfile contents

...

Python version

3.12

Locust version

2.24

Operating system

macOS or centOS

cyberw commented 7 months ago

huh. good find. unfortunately it will probably be hard to support, so I'll probably "fix" it by throwing an error (at least for now)

skyterra commented 7 months ago

I guess the reason it's hard to support is that in distributed mode, there's no shared data strategy. The single-process mode uses memory, while distributed mode would require introducing Redis or other memory database.

cyberw commented 7 months ago

Actually. When I think about it, it should work. Not sure when I'll have time to look at it though...

andrewbaldwin44 commented 7 months ago

It would be the same for distributed mode, we need to communicate between the workers and the master node so that the workers know that the list of tasks has changed. @cyberw Perhaps in the meantime we should throw an error or note something in the documentation that these arguments don't work together yet

cyberw commented 7 months ago

We shouldnt really have options that only work with non-distributed so we need to try and solve it (or remove task selection entirely). But erroring out when combined with --processes or --master is better than the current state I guess :)