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

FastHttpLocust times out when HttpLocust does not #1246

Closed
ThatOhio opened this issue Jan 27, 2020 · 4 comments
Closed

FastHttpLocust times out when HttpLocust does not #1246

ThatOhio opened this issue Jan 27, 2020 · 4 comments
Labels

Comments

@ThatOhio
Copy link

Describe the bug

While running some performance tests the last few weeks, I noticed that while using the FastHttpLocust client my requests would timeout at 5 seconds consistently on any request that took over 5 seconds to return. When using HttpLocust there was no timeout. I did not see an obvious setting I could change to increase the timeout for FastHttpLocust, and even if that setting exists, I would expect the defaults for both to be the same.

Expected behavior

The length of the timeout for both FastHttpLocust and HttpLocust should be the same, so that a timeout does not occur while using one or the other.

Actual behavior

If a request made with FastHttpLocust takes more than 5 seconds, but less than the default timeout for HttpLocust (I do not know this timeout, I believe it is 60 seconds?), the request should not timeout. The default timeout settings for FastHttpLocust should mirror that of HttpLocust.

Steps to reproduce

We setup an endpoint that simply waited 10 seconds and then returned, running the same locust file but swapping out HttpLocust with FastHttpLocust would produce different results (FastHttpLocust timing out after 5 seconds where HttpLocust did not).

Environment

  • OS: Ubuntu
  • Python version: 3.6.9
  • Locust version: 0.13.5
  • Locust command line that you ran: locust --host=http://web.site -f some_file.py
  • Locust file contents (anonymized if necessary):
from locust import HttpLocust, TaskSet, between
from locust.contrib.fasthttp import FastHttpLocust


def TimeoutTest(l):
    l.client.get('/timeout_test.php')


class UserBehavior(TaskSet):
    tasks = {TimeoutTest: 1}


class WebsiteUser(FastHttpLocust):
    task_set = UserBehavior
    wait_time = between(1.0, 2.0)

Swapping FastHttpLocust for HttpLocust to perform the same request with the HttpLocust. Our "/timeout_test.php" page was simply waiting 10 seconds to return.

@ThatOhio ThatOhio added the bug label Jan 27, 2020
@heyman
Copy link
Member

heyman commented Jan 27, 2020

Yes, gevenhttpclient (which is what FastHttpLocust uses) has a default timeout of 5 seconds. We should provide a way of specifying the timeout.

@cyberw
Copy link
Collaborator

cyberw commented Jan 28, 2020

I recently upped the timeout to 60 seconds because I encountered this problem myself (in master, not yet part of a release)

@ThatOhio
Copy link
Author

Awesome, I'll pull down the master branch when I need to extend the timeout until the next release, thanks!

@cyberw
Copy link
Collaborator

cyberw commented Feb 3, 2020

Released with 0.14.0!

@cyberw cyberw closed this as completed Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants