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
As it seems the current version uses the same client for all users, thus all users share the same session.
For testing the behavior of a webapp with say 100 concurrent user sessions, the client sessions in locust should be distinct. Additionally it should be possible to identify the current user or client. Our requirement is that each user uses a distinct login name in the login logic in on_start()
Or did I miss something and this is already doable?
The text was updated successfully, but these errors were encountered:
All users share the same test scenario or locustfile, but this doesn't imply that all users share the same session.
You could implement the logic for session in your locustfile. If you want your client sessions to be distinct I suppose you could do something like this:
# locustfile.py
import random
from locust import Locust, TaskSet, task
# load user credentials from file
user_credentials = read_user_credentials_from_file()
class MyTasks(TaskSet):
def on_start(self):
credentials = random.choice(user_credentials)
self.client.post("/login/", {"username":credentials[0], "password":credentials[1]})
@task
def some_task(self):
...
class MyLocust(Locust):
task_set = MyTasks
As it seems the current version uses the same client for all users, thus all users share the same session.
For testing the behavior of a webapp with say 100 concurrent user sessions, the client sessions in locust should be distinct. Additionally it should be possible to identify the current user or client. Our requirement is that each user uses a distinct login name in the login logic in on_start()
Or did I miss something and this is already doable?
The text was updated successfully, but these errors were encountered: