-
Notifications
You must be signed in to change notification settings - Fork 23
Fix/timeout server 2tries #198
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
Conversation
…ith a timeout multiplied by 2. If still TimeOutError, then raise.
This reverts commit 37c5d1c.
except TimeoutError: | ||
if timed_out: | ||
break | ||
timeout *= 2. |
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.
After a just a few attempts this timeout would grow quite large. Perhaps consider:
timeout *= 2. | |
timeout += 10. |
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.
@akaszynski in the current implementation, the time out is only increased once
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.
If it fails for something other than a TimeoutError, it does not go through timeout *= 2, and it can only go through it once. The thing is I did not want to make an assumption on the absolute timeout value given in input (once timeout comes from the calling function) so doubling made more sense than adding ten something.
@PProfizi you also told me that the timeout parameter cannot be changed up to the last method using it. Could you please update that as well? |
@PProfizi did you check that when the start_server function is rerun, the first started server (the one we failed ton connect to) is stopped and doesn't leave an unwanted process opened? |
I'll deal with @cbellot000 's last comments in a new PR. Sorry, I put this one on automatic merge. |
When debugging with PyCharm on my local machine, I kept having a lot of tests fail due to a TimeoutError during Server start-up. It turned out the default timeout of 10s was too little, so I added a second attempt with a timeout of 20s. If it still fails, then it raises the TimeoutError. This did the trick for me.