-
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
Update shape class' runner when Web UI picker is used #2534
Update shape class' runner when Web UI picker is used #2534
Conversation
Can you add a test case that fails without this change? |
There you go :) |
I see the need for the change, but |
I believe that we should avoid code repetition. Also I think that the action should be encapsulated by a method, as it wouldn't be clean to modify |
How about doing it here: https://github.com/locustio/locust/pull/2534/files#diff-498b8c363e788cc0210ac8600bce7660c60d210cad41af086886b79055c717beR636 Something like environment-runner separation is very messy, and while I dont like duplication, I like methods with unclear meaning even less :) |
your code, your rules ;) |
Thx! |
a shape class'
.runner
member is set by_create_runner
method ofEnvironment
class. However, when the UI picker is used, theshape_class
member of anEnvironment
instance is not initialized yet, hence, there's noRunner
assignment on initialization. Therefore, if you'd like to refer toself.runner
in your custom test shape (for instance to get the number of users running), you receive an error saying thatself.runner
isNone
.Hence, I added the shape class
runner
initialization also when the shape class is selected with UI picker.