From 8b6e9547c5e72c1579dc69f90fae844cdd3598c3 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Mon, 6 May 2024 11:59:25 +0200 Subject: [PATCH] Remove check for --expect-workers-max-wait without --expect-workers (it was broken and doesnt really make sense anyway) Log an error and crash if --expect-workers is not a positive number (otherwise we'll just wait forever). --- locust/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locust/main.py b/locust/main.py index 5e47e790d9..b2855715fe 100644 --- a/locust/main.py +++ b/locust/main.py @@ -411,8 +411,8 @@ def ensure_user_class_name(config): if options.worker: logger.error("The --master argument cannot be combined with --worker") sys.exit(-1) - if options.expect_workers_max_wait and not options.expect_workers: - logger.error("The --expect-workers-max-wait argument only makes sense when combined with --expect-workers") + if options.expect_workers < 1: + logger.error(f"Invalid --expect-workers argument ({options.expect_workers}), must be a positive number") sys.exit(-1) runner = environment.create_master_runner( master_bind_host=options.master_bind_host,