I am trying to do browser testing using Selenium, Chrome and a Ruby/Rails application using RSpec an Capybara. My builds pass successfully about every 1 in 4 runs; in the other 3, at some point all tests using Selenium fail with “connection refused” errors:
# Errno::ECONNREFUSED: # Connection refused - connect(2) for "127.0.0.1" port 9515
I don’t have any other debug information to go on other than the connection refused errors. I also cannot reproduce it locally. I have tried using different versions of Chrome, chromedriver, running Selenium locally as a .jar and using a Selenium chrome-standalone docker image. But, as the tests sometimes pass and sometimes fail, I suspect the basic configuration is alright, but something in my tests breaks it, or some memory limit is hit somewhere.
Does anyone have any idea what might be wrong, or what might possibly fix it?