Skip to content

Commit

Permalink
only check fixed count total against options.num_users if it is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Holmberg committed Aug 2, 2024
1 parent 5dbf27f commit 434e19c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ def kill_workers(children):
# list() call is needed to consume the dict_view object in Python 3
user_classes = list(user_classes.values())

fixed_count_total = sum([user_class.fixed_count for user_class in user_classes])
if not shape_class and fixed_count_total > options.num_users:
logger.info(
f"Total fixed_count of User classes ({fixed_count_total}) is greater than the specified number of users ({options.num_users}), so not all will be spawned."
)
if not shape_class and options.num_users:
fixed_count_total = sum([user_class.fixed_count for user_class in user_classes])
if fixed_count_total > options.num_users:
logger.info(
f"Total fixed_count of User classes ({fixed_count_total}) is greater than the specified number of users ({options.num_users}), so not all will be spawned."
)

if os.name != "nt" and not options.master:
try:
Expand Down

0 comments on commit 434e19c

Please sign in to comment.