rshf / chromedriver

Automatically exported from code.google.com/p/chromedriver
2 stars 1 forks source link

Closing chromedriver causes 'chrome not reachable' in other chromedrivers #795

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:

We have recently started to parallelize our functional tests (run using Jenkins 
+ Cucumber + Watir-Webdriver + ChromeDriver running on Linux 64-bit).  After 
the parallelization, we have started to see 'chrome not reachable' errors very 
often.

It seems that when closing a chromedriver, there's a chance it will also close 
the connection of a different chromedriver instance launched by another 
process.  The more chromedrivers are run in parallel, the more likely this is.

On my laptop, when I run the tests with five parallel instances, I get the 
'chrome not reachable' error pretty much every time.  When I modified the tests 
to include a delay at the end, allowing all tests to finish before closing any 
chromedriver instances, the tests pass every time.

This is making it impossible for us to parallelize our tests, and is really 
restricting the usefulness of our CI server.

Some more minute details are in the StackOverflow question I posted:  
http://stackoverflow.com/questions/23014220/webdriver-randomly-produces-chrome-n
ot-reachable-on-linux-tests

Tested using both Chrome and Chromium and ChromeDriver 2.9 and 2.10.  Currently 
I have Chromium 34.0.1847.116 and 2.10.267518, running on Linux Mint 16 
(64-bit).  Our CI server has Ubuntu.

Steps to reproduce:

Run several instances of tests in parallel, and let them end while others 
continue to run.  Every now and then the other tests start failing with 'chrome 
not reachable'.  Reproduction may be sporadic.

Original issue reported on code.google.com by sampo.ni...@mwsoy.com on 14 May 2014 at 10:54

GoogleCodeExporter commented 9 years ago
The problem is actually with using Xvfb and the headless gem.  It seems that 
running multiple Xvfb instances can interfere with each other.

Changing from using a separate Xvfb instance to a single instance for all 
parallel test runs removes the 'chrome not reachable' problem.  However this 
may cause a new 'Errno::ECONNREFUSED: Connection refused - connect(2)' problem.

This is documented in a few places:
http://rdoc.info/github/leonid-shevtsov/headless
http://sqa.stackexchange.com/questions/5833/connection-refused-error-when-runnin
g-selenium-with-chrome-and-firefox-drivers

Not yet 100% sure how to resolve this issue, possibly by forcing a separate 
Xvfb display number yourself.

In any case, this problem has been documented for Firefox as well, so this bug 
report can be closed.

Original comment by sampo.ni...@mwsoy.com on 2 Jun 2014 at 7:10

GoogleCodeExporter commented 9 years ago
Hi, I am having same issue. Previously was running with chromerdriver 2.4. We 
updated to chromedriver 2.10 and it's not possible to run chromes in parallel.

Running this on a Docker that contains:
Xvfb
Chrome: 36.0.1985.125
ChromeDriver: 2.10.267518
Selenium: 2.42.2 (don't think is relevant but anyways).

I can run the same suite in parallel on my laptop, and I can run the same test 
suite serially in the CI (TeamCity)

The exception that is being thrown is mostly Protractor-WebDriverJS, but adding 
it just in case:

[should login] UnknownError: chrome not reachable
  (Session info: chrome=36.0.1985.125)
  (Driver info: chromedriver=2.10.267518,platform=Linux 3.11.0-22-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2 milliseconds
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: '87b6824e6175', ip: '10.0.0.175', os.name: 'Linux', os.arch: 
'amd64', os.version: '3.11.0-22-generic', java.version: '1.7.0_55'
Session ID: 2366f36a5ac95fc9ccceaa4ac796fbe2
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, chrome={userDataDir=/tmp/.com.google.Chrome.gxteXT}, 
rotatable=false, locationContextEnabled=true, version=36.0.1985.125, 
takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, 
handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, 
webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
    at new bot.Error (/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:109:18)
    at Object.bot.response.checkResponse (/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
    at /node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:277:20
    at /node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1243:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1539:20)
    at notify (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:362:12)
    at notifyAll (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:331:7)
    at resolve (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:309:7)
    at fulfill (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:429:5)
    at /node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1406:10
==== async task ====
WebDriver.takeScreenshot()
    at webdriver.WebDriver.schedule (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:268:15)
    at webdriver.WebDriver.takeScreenshot (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:871:15)
    at to.(anonymous function) [as takeScreenshot] (/node_modules/protractor/lib/protractor.js:56:25)
    at _takeScreenshot (/shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/riqtor_utils/riqBrowser.js:452:24)
    at /shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/riqtor_utils/riqBrowser.js:439:24
    at /node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1243:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1539:20)
    at notify (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:362:12)
    at notifyAll (/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:331:7)
==== async task ====
Asynchronous test function: it()
    at /node_modules/protractor/node_modules/jasminewd/index.js:93:33
    at f (/shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/conf/confBase.js:78:15)
    at null.<anonymous> (/node_modules/protractor/node_modules/minijasminenode/lib/async-callback.js:45:37)
    at jasmine.Block.execute (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:1174:17)
    at jasmine.Queue.next_ (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2209:31)
    at jasmine.Queue.start (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2162:8)
    at jasmine.Spec.execute (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2503:14)
    at jasmine.Queue.next_ (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2209:31)
    at onComplete (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2205:18)==== async task ====
Error
    at /shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/spec/v2/web/followUpSpec.js:15:5
    at f (/shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/conf/confBase.js:69:15)
    at jasmine.Env.describe_ (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:913:21)
    at jasmine.Env.describe (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:898:15)
    at jasmine.Env.describe (/shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/conf/confBase.js:71:23)
    at describe (/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:658:27)
    at Object.<anonymous> (/shared/teamcity-agent/bd49cfa1cd227f91482091877cb41b6a/work/35d17650c0d95072/spec/v2/web/followUpSpec.js:4:1)
    at Module._compile (module.js:456:26)

Original comment by fernando...@relateiq.com on 8 Aug 2014 at 5:51

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
This issue looks similar to: 
https://code.google.com/p/chromedriver/issues/detail?id=977 

We are unable to reproduce issue with latest Chrome:v41 and ChromeDriver:2.14
Please refer to:
https://code.google.com/p/chromedriver/issues/detail?id=977#c46

Original comment by ssudunag...@chromium.org on 25 Mar 2015 at 5:33

GoogleCodeExporter commented 9 years ago

Original comment by ssudunag...@chromium.org on 26 Mar 2015 at 6:41