-
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
SequentialTaskSet is broken when using local class members (headless mode) #1379
Comments
Hi! I think the problem is that you're overwriting the self.user variable. It refers to the User class (it used to be self.locust). Name it anything else and it should work. |
We could prevent this kind of issues by making user a read-only property. Probably wasnt as big a problem when the variable name was more uncommon (locust), but now I can definitely see more people running in to this. Something like this.
|
ooooh I see :) yeah it makes sense, I'll rename it |
…ead-only-properties Make TaskSet .user and .parent read only properties, avoids / fixes #1379
Describe the bug
Trying to execute a SequentialTaskSet in headless mode, store result's from first task, and use it in second task
Expected behavior
Execute first task, retrieve json, store it as dict in SequentialTaskSet object, execute second task and access the variable.
Actual behavior
Execute first task, json is retrieved, stored. In second task upon trying to access the stored data, I get following exceptions:
1.) AttributeError: 'dict' object has no attribute '_state'
2.) AttributeError: 'dict' object has no attribute 'environment'
Steps to reproduce
Start provided mockserver.py (flask) on localhost:5000, then run provided locust file (sequence_test.py) with command lines specified
Environment
Ubuntu 18.04.4 LTS running in WSL
Linux PSALA059 4.4.0-18990-Microsoft Add/improve support for running Locust distributed #1-Microsoft Sat Sep 21 17:04:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
3.6.9
locust 1.0.1
run master locust:
locust -f sequence_test.py --host=http://localhost:5000 --master --expect-workers=1 --headless -u 1 -r 1 -t 1h
run worker locust:
locust -f sequence_test.py --worker --master-host=127.0.0.1 --host=http://localhost:5000
locust-1.0.1-sequence-bug.zip
The text was updated successfully, but these errors were encountered: