-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Custom argument values didn't passed into a worker in distributed mode #3206
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
bugstaleIssue had no activity. Might still be worth fixing, but dont expect someone else to fix itIssue had no activity. Might still be worth fixing, but dont expect someone else to fix it
Description
Prerequisites
- I am using the latest version of Locust
- I am reporting a bug, not asking a question
Description
After starting both master and worker I'm opening webui on port 8089 and changing custom argument values there.
As for me, I see default values, not the ones that I provided in webui.
Command line
locust --master --master-port 8089
Locustfile contents
from locust import constant, task, events
from locust.user.users import HttpUser
@events.init_command_line_parser.add_listener
def add_custom_arguments(parser):
# add arguments that we should see in GUI
parser.add_argument(
"--arg1",
type=str,
help="Some argument 1",
default="Foo",
)
parser.add_argument(
"--arg2",
type=int,
help=f"Some argument 2 (default: {10})",
default=10,
)
class MyUser1(HttpUser):
host = "http://example.com"
wait_time = constant(1)
@task
def get_ip(self):
print(
"pasred custom args: "
f"arg1={self.environment.parsed_options.arg1}, "
f"arg2={self.environment.parsed_options.arg2}"
)Python version
3.12
Locust version
2.40.1
Operating system
WSL (Ubuntu)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugstaleIssue had no activity. Might still be worth fixing, but dont expect someone else to fix itIssue had no activity. Might still be worth fixing, but dont expect someone else to fix it