You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: Linux
Selenium Version: any
Browser: chrome, probably firefox as well
Browser Version: Any
How currently works
Once we create a webdriver.Remote selenium server tries to find an acceptable port to start the "new driver"(I'm not that familiar with the terms).
Digging into the code I noticed that we explicitly avoid ephemeral ports, probably to avoid race conditions with other systems binding on port 0.
This is the code path that does this:
It could be a port capability that would allow others to actually specify selenium which port it should run the new driver, another solution I'd like is to actually provide selenium server a range which we consider acceptable, the latter wouldn't require adding a new capability and we could control when starting the server.
The text was updated successfully, but these errors were encountered:
Meta -
OS: Linux
Selenium Version: any
Browser: chrome, probably firefox as well
Browser Version: Any
How currently works
Once we create a
webdriver.Remote
selenium server tries to find an acceptable port to start the "new driver"(I'm not that familiar with the terms).Digging into the code I noticed that we explicitly avoid ephemeral ports, probably to avoid race conditions with other systems binding on port
0
.This is the code path that does this:
selenium/java/client/src/org/openqa/selenium/net/PortProber.java
Line 80 in 02a0df9
Other systems that have full control of the host might have fixed ports for isolation, but selenium races with them.
The same thing happens with chromedriver, they have a similar approach but at least they have a fixed range that we can avoid:
https://cs.chromium.org/chromium/src/chrome/test/chromedriver/server/http_handler.cc?l=88
I think it is great the selenium actually finds a random non-ephemeral port, but this might have side effects on other distributed systems.
My proposal is to add a new capability to Remote:
selenium/java/client/src/org/openqa/selenium/remote/CapabilityType.java
Line 23 in 3cd7889
It could be a
port
capability that would allow others to actually specify selenium which port it should run the new driver, another solution I'd like is to actually provide selenium server a range which we consider acceptable, the latter wouldn't require adding a new capability and we could control when starting the server.The text was updated successfully, but these errors were encountered: