Running Nightwatch tests on CI in Chrome. Sometimes (about once in 5 builds) I encounter following error, in one of the tests. Every test before this one works fine.
I have the latest Chromedriver and Selenium standalone server.
I figured that the problem is that Selenium server crashes mid-request, tough I don't know why.
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ Error: socket hang up
at createHangUpError (_http_client.js:254:15)
at Socket.socketCloseListener (_http_client.js:286:23)
at emitOne (events.js:101:20)
at Socket.emit (events.js:188:7)
at TCP._handle.close [as _onclose] (net.js:498:12) code: 'ECONNRESET' }
Also here is part of my nightwatch.json
that takes care of selenium.
"selenium": {
"start_process": true,
"server_path": "scripts/Nightwatch/selenium-server-standalone-3.0.1.jar",
"log_path": "app/E2E/reports/selenium",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "scripts/Nightwatch/chromedriver"
}
}
Any ideas why is Selenium crashing and how to fix this issue?
xvfb-run npm run e2e
working now – Marras