You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about how Locust works when specifying multiple users. I run locust --no-web -c 1 -r 1 expecting 2 users spawned at 1 user/sec. I see my HttpLocust-level setup() runs only once, so I assumed there is only 1 Locust instance regardless of number of users even though the output says that 2 ExampleLocusts hatch.
When the example task runs for the first user, everything prints out normally. When the example task runs for the second user, it prints "bye" and then "None" for the table instance variable. Why is my env instance variable saving the value and the table variable not?
I just accepted that setup() in the HttpLocust class will only run once per program execution. I put any user-specific data I need to load in on_start() in the TaskSet / TaskSequence class
I have a question about how Locust works when specifying multiple users. I run
locust --no-web -c 1 -r 1
expecting 2 users spawned at 1 user/sec. I see my HttpLocust-level setup() runs only once, so I assumed there is only 1 Locust instance regardless of number of users even though the output says that 2 ExampleLocusts hatch.When the example task runs for the first user, everything prints out normally. When the example task runs for the second user, it prints "bye" and then "None" for the table instance variable. Why is my env instance variable saving the value and the table variable not?
Ty in advance.
Code:
`
class ExampleLocust:
task_set = basicTaskset
host = "whatever"
table = None
env = {}
class ExampleTaskSet(TaskSequence):
tasks = [exampleTask]
def exampleTask(l):
print(l.locust.env["hello"])
print(l.locust.table)
`
The text was updated successfully, but these errors were encountered: