-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Occasional EADDRINUSE by chromedriver causes crash #2888
Comments
Underlying problem is the chromedriver does not use keep-alive, so the wait loop is exhausting your ephemeral ports with short-lived connections while it polls the server. Unfortunately, I haven't been able to trigger this on my machine, even with an indefinite wait. You could try tweaking the number of maximum connections on |
I've got the same problem while trying to run multiple chromedrivers in parallels (and hence using lot's of sockets), tweaking neither |
It's an OS limit you are hitting. Windows doesn't come out of the box tuned for high throughput. You need to adjust the TCP settings of your OS to increase pool size for ephemeral ports. |
@cgoldberg - thanks for the ephemeral ports suggestion! Posted a powershell script on serverfault that will adjust these windows settings without having to manually dig thru the registry or deal with netsh commands. We were also seeing the |
Hello, Guys! |
Any info, Guys? We are facing this issue more&more regularly with Chrome. |
selenium-webdriver can issue keep-alive connections, but ChromeDriver doesn't support them, so there is nothing we can fix here. |
@p0deje thank you for making it clear! |
This is a huge, intermittent pain in the ass for my tests on a Windows 10 PC. @p0deje , would it make sense to:
|
I think it makes sense to retry on EADDRINUSE all the time. At least I see that Ruby bindings do it. However, I'm not very familiar with NodeJS bindings, so either Jason needs to implement it or pull request is welcome! |
Ran into this issue on my local Win 10 dev machine - all tests would start erroring with EADDRINUSE after about 60 sec. After a bit a of digging I found the official MSDN doc with clear steps for tuning Win-based machine to workaround this issue. I am posting it here for reference. |
Had this issue as well. We came up with a solution, however please keep in mind it's a jest-specific solution, and not a general solution for this issue. Our issue arose when we ran our jest testing and multiple workers spun up different instances of the chromedriver. By decreasing the maximum allowed number of workers (parallel instances), using the
|
Meta -
OS: Windows 10
Selenium Version: 3.0.0-beta-2 (NodeJS)
Browser: Chrome
Browser Version: 53.0.2785.116 (Official Build) m (32-bit)
Expected Behavior -
Attempt to resolve connection if possible, or at least allow users to provide their own error handler.
Actual Behavior -
Unsure if this is a chromedriver issue, selenium webdriver issue or an operator issue. Occasionally during a portion of my tests where I conduct a fair bit of waiting in the form:
I receive an error from https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/http/index.js#L238.
Without having delved into the actual implementation, I assume that this code, under the hood, will open many repeat connections to the chromedriver in order to poll for element state. After a while, this eventually causes an
EADDRINUSE
error to be thrown by the above linked error handler, causing the webdriver to stop. This issue does not happen when using firefox. Error in question:I fixed this issue locally by replacing above error handler with:
This works fine. If you add a console log above for each retry it retries maybe 5-10 times before it starts working again. This makes me think that the issue is with clogging up the communications (
netstat -a
shows the ports hitting 65535 with requests to the what I can only assume is the chromedriver).I have tried running chromedriver in verbose mode with logging turned on, there are no events being displayed from within chromedriver to indicate that it is failing.
If this is an issue with chromedriver instead of webdriver please close this and I will see what they have to say on the issue.
Steps to reproduce -
Can't easily provide as the point at which this occurs is variable, however it always happens inside tests with the above wait-based code.
The text was updated successfully, but these errors were encountered: