-
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
fixed load/users getting distributed to missing worker #2010
fixed load/users getting distributed to missing worker #2010
Conversation
Can you add a unit test? You can override/shorten the timeout in the tests to reduce the time they take by using pytests mock feature (there should be some examples among the tests) |
It asserts to Count of active workers in dispatch.. Here the missing worker
should be removed after heartdead interval.. Added comment to code and
added more sensible message in assert
…On Sat, 12 Feb, 2022, 19:46 Lars Holmberg, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In locust/test/test_dispatch.py
<#2010 (comment)>:
> + weight = 1
+
+ class User3(User):
+ weight = 1
+
+ user_classes = [User1, User2, User3]
+
+ worker_nodes = [WorkerNode(str(i + 1)) for i in range(3)]
+ worker_nodes[1].heartbeat = HEARTBEAT_DEAD - 1
+
+ users_dispatcher = UsersDispatcher(worker_nodes=worker_nodes, user_classes=user_classes)
+
+ users_dispatcher.new_dispatch(target_user_count=9, spawn_rate=3)
+ users_dispatcher._wait_between_dispatch = 0
+ users_dispatcher.prepare_rebalance()
+ list(users_dispatcher)
what does this line do? :)
—
Reply to this email directly, view it on GitHub
<#2010 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJXIJ6SAZXB7U6XXLQS2LHLU2ZTUVANCNFSM5OFSJBIA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
locust/dispatch.py
Outdated
@@ -16,6 +16,8 @@ | |||
if TYPE_CHECKING: | |||
from locust.runners import WorkerNode | |||
|
|||
HEARTBEAT_DEAD = -10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import from runners instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, but was getting error during initialization.
Will try the reverse tomorrow..
Could you help me with any resource on how to setup debugging in distributed mode.. That would be really helpful for me to contribute in a better way.. I am resorting to print statement for debugging(This is my first python project)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I dont have much to contribute with debugging distributed. You know how to run an individual unit test, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, initially used to run tox.. later found out the way to run individually.
Ignore the python 3.6 failure, that test is just flaky I think... |
Hi @radhakrishnaakamat, can you link this PR to the corresponding issue #2008? |
👍👍 |
fixed load/users getting distributed to the missing workers.
I am new to open source commit and python.
Please let me know if anything needs to be changed.
fixes #2008 #2010