nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

nightwatch exit code is 0 after not getting a selenium session #1017

Closed lampe closed 8 years ago

lampe commented 8 years ago

We are running nightwatch with saucelabs and sometimes saucelabs is not reachable so we cant start the selenium server. Nightwatch then can't retrieve a session from Selenium and it exits.

nightwatch --config ./scripts/test/e2e/configs/teamcity/nightwatch.js -e saucelabs
echo $?
  1. on the console we get this: Error retrieving a new session from the selenium server
  2. $? returns 0

Nightwatch version v0.9.3 Sauce-connect 4.3.16

beatfactor commented 8 years ago

I can't reproduce this. Can you somehow reproduce the issue, run it with --verbose and post the output here?

drptbl commented 8 years ago

@beatfactor I have exactly the same issue.

My setup: Jenkins 2+ (runs jobs) Selenium Grid Extras hub on Ubuntu 14 Selenium Grid Extras node on Windows 7

Tests randomly failed with this error:

05:57:07 Running:  Check that article title is visible
06:01:33
06:01:33 �[1;31mError retrieving a new session from the selenium server�[0m
06:01:33 { status: �[33m13�[39m,
06:01:33   value: 
06:01:33    { message: �[32m'Error forwarding the new session Error forwarding the request Read timed out'�[39m,
06:01:33      class: �[32m'org.openqa.grid.common.exception.GridException'�[39m } }
06:01:33 
06:01:33 �[0;31m
06:01:33 Connection refused! Is selenium server started?

I thought this is related to setup issues with Selenium or VM's, but increasing Selenium timeouts didn't help. Then I've got directed that this may be Nightwatch.js issue. Some days ago I've updated my Nightwatch.js from 0.8.6 to 0.9.5, but I totally forgot about that. Now I'm back to 0.8.6, but this didn't seem to help. Hmm.. Not sure where to look at now.. I had 0.8.6 running fine before, without errors, but I can't reproduce this setup now.

Cheers!

beatfactor commented 8 years ago

This is a duplicate of https://github.com/nightwatchjs/nightwatch/issues/1093 and a fix will be posted very soon, therefore I'm closing this.

aberonni commented 6 years ago

@beatfactor I just got the same issue with the latest verison of nightwatch. I'm not sure whether this is a regression or if the linked bug was actually something different.

I received the error Error retrieving a new session from the selenium server yet the exit code is 0. https://github.com/nightwatchjs/nightwatch/blob/a8c16525317f028da20b4251cbc7174f6dcea20f/lib/index.js#L490

Should I open another bug or should we reopen this one? If it could come in handy I can open a new bug with full test case for reproducing. Maybe even PR for fix.

beatfactor commented 6 years ago

@aberonni If you don't mind, please open another bug for this, thanks.

aberonni commented 6 years ago

@beatfactor opened #1677 thanks