teerapap / grunt-protractor-runner

A Grunt plugin for running protractor runner.
MIT License
149 stars 123 forks source link

Error: ECONNREFUSED connect ECONNREFUSED if keepAlive = true #111

Open p-p-m opened 9 years ago

p-p-m commented 9 years ago

I have an error, similar to error described in issue#99(https://github.com/teerapap/grunt-protractor-runner/issues/99)

Shut down Selenium server: http://127.0.0.1:4444 (OKOK)

/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145
      callback(new Error(message));
               ^
Error: ECONNREFUSED connect ECONNREFUSED
    at ClientRequest.<anonymous> (/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145:16)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at Socket.socketErrorListener (http.js:1547:9)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.quit()
    at [object Object].webdriver.WebDriver.schedule (/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:345:15)
    at [object Object].webdriver.WebDriver.quit (/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:418:21)
    at /home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/lib/driverProviders/driverProvider.js:28:16
    at /home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
    at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
    at notify (/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12)
    at [object Object].then (/home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:522:7)
    at /home/pavel/Python/projects/nodeconductor-web/node_modules/protractor/lib/driverProviders/driverProvider.js:26:25
    at Array.map (native)
[launcher] Process exited with error code 1

This error occurs then I use grunt-protractor-runner with grunt-protractor-webdriver and set keepAlive to false. As I understand grunt-protractor-webdriver shuts down Selenium too early and this causes error.

mikpan commented 9 years ago

+1 on Ubuntu 12.04

sandromartis commented 9 years ago

Same here on Windows 8. Also using grunt-protractor-webdriver in combination with grunt-protractor-runner.

Seems only to happen with Chrome and IE, but not with Firefox.

chazzlabs commented 9 years ago

Also seeing this on Windows 8.1. Adding

keepAlive = true

to my grunt-protractor-webdriver options resolves it, but that seems like a shaky workaround.

mwager commented 9 years ago

same problem here, it only works if I set keepAlive to true, but the exception is thrown anyway:

... tests green ...
Finished in 10.233 seconds
1 test, 2 assertions, 0 failures

Session deleted: Going to shut down the Selenium server
Shutting down Selenium server: http://127.0.0.1:4444
Shut down Selenium server: http://127.0.0.1:4444 (OKOK)

/path/to/src/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145
      callback(new Error(message));
               ^
Error: ECONNREFUSED connect ECONNREFUSED
...
[launcher] Process exited with error code 1
>> 
>> Test failed but keep the grunt process alive.

Done, without errors.
masterspambot commented 8 years ago

directConnect: true

Solves the problem for Chrome and FF.

yaronguez commented 8 years ago

What is the latest way to handle this on Windows 10? Setting keepAlive and directConnect to true to not resolve the ECONNREFUSED error. I can only get around this by manually starting a webdriver in a new command window but that defies the purpose of the grunt runner.