-
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
Negative min_response_time shown in stats #1487
Comments
This line is returning a negative value: Line 117 in b18cf1e
Perhaps a docker clock source issue 🤔 Docker itself just using the host clock source but docker on Mac (what I'm using) uses HyperKit VM as Mac kernel doesn't support native docker. Perhaps this VM clock source is not reliable? |
There's lots of docker clock issues but as far as I can see they are related to sleep: moby/hyperkit#110 If it was a docker issue, it would be easy to reproduce outside of locust with a file like this: import time
while True:
t = time.time()
if time.time() < t:
print('ERROR: {0} is less than {1}'.format(time.time(), t))
break And then run it like |
Ah, after leaving this for a while I get an error 😅
OK, good to know! |
Should we make a change to the locust code though? Like to record the response time as |
Can you try replacing the two calls to time.time() with time.monotonic()? I thought we did that a long time ago, but maybe it was only done for FastHttpUser or something. |
Interesting.
I don't think we should "hide" the clock issue by setting it to zero if it's negative. |
Makes sense
This solves it for me. Both in docker without locust and in my locust test. Shall I make a PR to switch any time measurement to use |
Please do! |
Done: #1492 |
Describe the bug
Negative value shown for
min_response_time
:Expected behavior
0 or positive value.
Actual behavior
Negative value shown for
min_response_time
Steps to reproduce
I have a branch local docker-compose setup to reproduce it easily. But it's just 1 worker calling nginx in another docker container.
Environment
The text was updated successfully, but these errors were encountered: