2

On my current project we're using iWebDriver to run acceptance tests on our CI server.

Occasionally, we see the error:

Connection refused - connect(2) (Errno::ECONNREFUSED)

Thus far, we have found no pattern to this failure; whenever we encounter it, we simply restart the build and it generally runs successfully. I'd say this happens roughly 10% of the time.

Before everybody jumps on me for ignoring a real problem: we capture screenshots whenever there is a test failure. Whenever this particular error occurs, there doesn't appear to be an actual problem based on the captured screenshot. It is not the same as a simple timeout error (where, e.g., an element isn't found in time); in that case we see a different message: execution expired (Timeout::Error).

We're all kind of under the assumption that this is due to some erratic bug in WebDriver itself. Which tempts me to implement a script that simply detects the above error message and restarts the build if it's detected but otherwise yields real failures. (Actually, I've already done that; I simply haven't configured our build server to use it, yet.)

Have others seen this intermittent error? Is it a known issue? Does it actually indicate a real problem that we should investigate on our end (in which case, where do we start)?

Dan Tao
  • 125,917
  • 54
  • 300
  • 447
  • 1
    Are you using firefox driver? Firefox driver uses port 7055 by default to communicate. Is there something else in your application that using the same port at that time you are getting the error? "Connection Refused" seems like a TCP port error – nilesh Sep 08 '11 at 00:35
  • @nilesh: We're actually using iWebDriver to run acceptance tests on the iPhone simulator. That seems like a helpful clue, though. Do you happen to know off the top of your head a good way to check for a port conflict? – Dan Tao Sep 08 '11 at 01:54
  • I am not sure how to find port conflict top off my head. Reading about iWebDriver says below so my guess about the TCP issue is getting stronger :)- "The iphone driver connects through HTTP to the iphone, ipod or iphone simulator. You can run the simulator on another machine on your network and configure webdriver to connect to it remotely." – nilesh Sep 08 '11 at 02:11
  • Does this always happen on the same API call, or is it random? (Seeing the stacktrace of the error would be helpful.) What happens in the iWebDriver log when the error occurs? Is the test running on the same machine as the simulator? – jarib Sep 10 '11 at 22:39

0 Answers0