Webdriver accidentally produces “chrome not reachable” on Linux tests

Our CI tests randomly fail with a "chrome not reachable" error. Initially, they were quite rare, but as our test base grew, this became unbearable. There are a few other questions / bug reports, but none of them seem to be relevant to our case.

Tests are written using Cucumber + Ruby + Watir-Webdriver + Selenium-Webdriver (latest versions of each gem). We run tests on Ubuntu Linux 12.04 in headless mode using xvfb on physical hardware (without virtualization). I can play it quite reliably on my laptop running Linux Mint 16. We run tests in parallel to speed things up.

I tried using Chromium 18.0.1025.151 ~ r130497-0ubuntu1 and Google Chrome 34.0.1847.116, with ChromeDriver v2.9.248304. The same problem arose with older versions of the browser and ChromeDriver.

Typically, multiple tests fail on a line due to the same error, and then re-run the test again at the same start.

Stack trace:

chrome not reachable (Session info: chrome=34.0.1847.116) (Driver info: chromedriver=2.9.248304,platform=Linux 3.2.0-60-generic x86_64) (Selenium::WebDriver::Error::WebDriverError) /home/weller/jenkins/workspace/TEST_CHROME_C/server/cucumber/support/step_support/browsers.rb:14:in `goto' /home/weller/jenkins/workspace/TEST_CHROME_C/server/cucumber/support/step_support/browsers.rb:35:in `blank_page' /home/weller/jenkins/workspace/TEST_CHROME_C/server/cucumber/support/step_support/browsers.rb:44:in `add_cookie' ./features/support/mocking.rb:11:in `mock' ./features/support/time_steps.rb:5:in `/^the current time zone is "(.*?)"$/' features/trackers/mood/mood_data_entry.feature:7:in `And the current time zone is "GMT+4"' 

Update: The problem seems to be related to parallelism. When one of the tests comes out, there is a chance that the other will begin to fail with "chrome inaccessible." If I add a delay to the end of the tests so that all tests finish before all Chrome windows close, the tests run without problems. I reported an error regarding ChromeDriver error.

+8
google-chrome selenium-webdriver webdriver selenium-chromedriver
source share
2 answers

I had the same problem, in my case it was because user-data-dir, which was randomly created by a chrome edge, in some cases was the same for several tests. I solved this by synchronizing the creation of webdriver (this does not affect the performance)

+1
source share

You can try with the settings below,

1) Do not perform many Jenkins tasks 2) Try to use fewer threads, not more threads to create a browser.

This will solve your problem.

In case you have more tests, you should implement a selenium grid.

0
source share

All Articles