Skip to content

Commit

Permalink
Dont filter out User classes with weight == 0 but fixed_count > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Jan 25, 2022
1 parent 7bff126 commit 5951ea4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion locust/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def _remove_user_classes_with_weight_zero(self):
if len(self.user_classes) == 0:
# Preserve previous behaviour that allowed no user classes to be specified.
return
filtered_user_classes = [user_class for user_class in self.user_classes if user_class.weight > 0]
filtered_user_classes = [
user_class for user_class in self.user_classes if user_class.weight > 0 or user_class.fixed_count > 0
]
if len(filtered_user_classes) == 0:
# TODO: Better exception than `ValueError`?
raise ValueError("There are no users with weight > 0.")
Expand Down

0 comments on commit 5951ea4

Please sign in to comment.