add support to bind to port 0 in emrun#18775
Conversation
| logi('Web server root directory: ' + os.path.abspath('.')) | ||
| logv('Starting web server: http://%s:%i/' % (options.hostname, options.port)) | ||
| httpd = HTTPWebServer((options.hostname, options.port), HTTPHandler) | ||
| options.port = httpd.socket.getsockname()[1] |
There was a problem hiding this comment.
maybe add a comment here? otherwise it is a little odd to see port passed in and then read back.
There was a problem hiding this comment.
Good call. Added.
|
I wonder if we could use this to parallelize our browser test suite here... (edit: not this specifically, as we don't use emrun for most tests, but we could spawn in parallel using port 0) |
This will certainly open the door, our native tests are all with gtest so we are able to leverage the sharding it can do. |
I don't think the browser test suite uses emrun. I'm also not sure lack of port numbers would be blocking factor there. |
Allowing port 0 binding will find an available port automatically.
This is useful in situations where you want run emrun multiple times with something like GNU parallel
Example output