-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MasterRunner target_user_count no longer set for test_start event listeners #1883
Comments
Thanks for the nice and detailed description. I think this is either @mboutet 's area (the only relevant PR between b1 and b2 was made by him) or @nathan-beam 's as he wrote the custom messages feature. |
I see where the issue is coming from. The relevant changes are here. Before Switching to this approach of weighing on-the-fly was one of the key point in addressing the performance issues while addressing the other issues in #1621. Right now, the self.target_user_classes_count = self._users_dispatcher._distribute_users(user_count)[0] at line: Line 690 in 1c65699 The downside is that calling _distribute_users for a large user count (I'd say more than 30k-50k users) can be computationally expensive, but I think for most use cases, this should not be a problem.
Another solution could be to no longer compute |
Hmm... I think your second proposed solution, while a little more limited in what flexibility we give the user, is better. Doing all that work just to get the target user count (which already exists) just doesnt feel right. I think it is reasonable to assume that 99% of tests will not require exact knowledge of the count of each user class. If that is necessary, then maybe it is something we could allow the locustfile to calculate only if it is needed. |
If there's another mechanism for retrieving the target user count that was entered in the WebUI or passed in via the |
As a workaround, if you specify the number of users on command line you can get it from |
Hello, I'm having the exact same issue, even after updating to 2.2.3. |
Thanks for the fix! While the PR did provide a solution that works for my use-case, the I'm unsure whether or not that's a behavior you want to put back in. If there's no plan to add that back in, then the Thanks again. UPDATE: Output from my previous instructions + stop and restart the test with 10 users again, then stop and restart the test with 7 users. Note that for the final run with 7, the logs report that the MasterRunners target_user_count was 10 (from the prior run), though the WorkerRunners reported 3 and 4, to equal the 7 requested.
|
Thanks again! You all are awesome. Just confirmed that everything is functioning as expected using the latest on master. |
Describe the bug
I was following the
custom_messages.py
example and noticed thatenvironment.runner.target_user_count
is no longer resolving to the number of users being created for the test. This functionality appears to have been broken between tags2.0.0b1
and2.0.0b2
.Expected behavior
The MasterRunner's
target_user_count
should resolve to the number of users specified in the WebUI for the test.The
custom_messages.py
example for a test with 10 users and 2 workers should log a message from each worker indicating that they received 5 users.Actual behavior
The MasterRunner's
target_user_count
is 0, causing numerous exceptions in thecustom_messages.py
example.Steps to reproduce
docker-compose.yml
:docker-compose.yml
docker compose up
docker-compose.yml
to use a different image tag listed below and repeat steps 3 and 4.Environment
Debian GNU/Linux 11 (bullseye)
fromlocustio/locust
docker image.3.8.11
and3.8.12
from the variouslocustio/locust
docker images.2.0.0b2
,2.0.0b3
,2.1.0
,2.2.0
,2.2.1
docker-compose.yml
above.The text was updated successfully, but these errors were encountered: