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
Add WithContext and WithTimeout #92 #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Here are a few comments.
per request tests with both context and timeout
@gavv Pushed all the changes you requested. |
Thanks for update! A few final minor comments. |
Looks legit |
It seems there is a possible deadlock in the new tests. I've run this:
( And eventually |
(Also it seems that goroutines are leaking in TestE2EWebsocketTimeouts, but I think this is unrelated; those goroutines are excluded from trace) |
I'll look into this shortly. |
@gavv can you reproduce with
? |
Hm, yes, it's reproducing, but only without I guess that with Another opportunity is that the problem is indirectly caused by other tests, e.g. by gorotuine leak mentioned above - I didn't try to debug it yet. My env:
|
@gavv I can reproduce as well. The problem is with the WithTimeout tests. There is no problem when omitted. I'll try to debug. |
minor readability improvements
@gavv It seems that the problem is the default timeout for go test, which is 10m(inutes). A single test run lasts in my environment 6.317s(econds). For -count=100, this will be at least 631.7s>10m. Simply increasing the timeout to 11m will result in passing the test run:
In any case, I've set the various WithTimeouts to 500ms so that the tests complete under the default 10m for count=100. |
Never mind, I expected the timeout is per-test... Thanks for looking into it and for the PR! |
Overall I've followed the in-issue guide. Still need to look into a suspicious defer inside retryRequest but this will suffice for review.