Skip to content
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

How do I start a new session #356

Closed
anabuki opened this issue Oct 28, 2015 · 3 comments
Closed

How do I start a new session #356

anabuki opened this issue Oct 28, 2015 · 3 comments

Comments

@anabuki
Copy link

anabuki commented Oct 28, 2015

Hello,

I am trying to start a load process but I want to test not only my application but also my authentication infrastructure. I want my webserver to authenticate every request instead of reusing sessions. I am testing a rest api that uses basic authentication.

The idea is that I have millions of mobile users making a single request by day instead of a few thousands making constant use of the application.

Can anyone help me ?

@vividhsv
Copy link

From requests documentation it can be seen that requests.Session class has close() method. You can probably call slef.client.close() after each request so that new connection are made for each request.

I have never tried this, just an idea.Let me know if it works. More on this can be found in the documentation.
http://docs.python-requests.org/en/latest/api/#requests.Session

@anabuki
Copy link
Author

anabuki commented Oct 28, 2015

Thanks man!! I am going to make some changes to my script to adapt better for my tests but for the time being it is working beautifully :)
Really appreciate the help :)

@anabuki anabuki closed this as completed Oct 28, 2015
@BrandonLiang
Copy link

Hi, were you able to get it to work? If so, could you share you script?

https://docs.locust.io/en/stable/_modules/locust/contrib/fasthttp.html#FastHttpUser.rest, FastHttpSession (FastHttpUser.client) has no method close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants