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
Output correct port if port=0, refs #530 #531
Conversation
Weird: https://travis-ci.org/encode/uvicorn/jobs/627147183 Test fails but only under Python 3.6:
|
@@ -428,6 +428,9 @@ def run(self, sockets=None): | |||
except OSError as exc: | |||
logger.error(exc) | |||
sys.exit(1) | |||
port = config.port | |||
if port == 0: | |||
port = server.sockets[0].getsockname()[1] |
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.
Will server.sockets
only ever have a single item in the list here? I think so but I'm not certain.
Thanks @simonw.
Righty, that's actually a flaky test right there, since it's dependant on the time resolution and how quickly the Let me take a look at resolving that, then once that's in you can merge master back into this. |
Righty, worth pulling master into this now, which ought to resolve the issue. |
That fixed it! |
Should fix #530