We have a virtual Windows 7 image where our CI runs our functional tests on IE10. The functional tests are written in Ruby using Cucumber + Watir-Webdriver.
Most of the time it works fine, but every now and then every test starts failing with the following exception:
EXCEPTION: SocketError: getaddrinfo: No such host is known.
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/common/platform.rb:169:in `getaddrinfo'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/common/platform.rb:169:in `localhost'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/remote/bridge.rb:48:in `block in initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/remote/bridge.rb:48:in `delete'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/remote/bridge.rb:48:in `initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/common/driver.rb:35:in `new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver/common/driver.rb:35:in `for'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.34.0/lib/selenium/webdriver.rb:67:in `for'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.4/lib/watir-webdriver/browser.rb:46:in `initialize'
C:/jenkins/workspace/TEST_IE10/server/cucumber/support/step_support/browsers.rb:212:in `new'
C:/jenkins/workspace/TEST_IE10/server/cucumber/support/step_support/browsers.rb:212:in `new_ie_browser'
C:/jenkins/workspace/TEST_IE10/server/cucumber/support/step_support/browsers.rb:99:in `new_browser'
C:/jenkins/workspace/TEST_IE10/server/cucumber/support/step_support/browsers.rb:132:in `browser'
C:/jenkins/workspace/TEST_IE10/server/cucumber/client/features/support/clients/client_support.rb:54:in `new_client'
C:/jenkins/workspace/TEST_IE10/server/cucumber/client/features/support/clients/client_support.rb:72:in `client'
C:/jenkins/workspace/TEST_IE10/server/cucumber/client/features/support/clients/client_steps.rb:14:in `Before'
Often no further test runs will work until I reboot the virtual machine, then it again works for a few days.
I checked selenium-webdriver's code and the failing line is:
info = Socket.getaddrinfo "localhost", 80, Socket::AF_INET, Socket::SOCK_STREAM
We have no proxy in use, and communication should occur only within out intranet. Internet access is available though. The hosts file does not contain any entry for localhost. We're using selenium-webdriver 2.34.0. Our Win7/IE9 virtual machine with the same config has no such issues.