We have a number of WatiN tests running from CruiseControl, but we get intermittent failures. The most common failure point is when doing really simple things, such as clicking a link. Here are two example stack traces...
WatiN.Core.Exceptions.TimeoutException: Timeout while waiting for main document becoming available ---> System.IO.IOException: The operation is not allowed on non-connected sockets. at System.Net.Sockets.NetworkStream.InitNetworkStream(Socket socket, FileAccess Access) at WatiN.Core.Native.Mozilla.FireFoxClientPort.SendCommand(String data) at WatiN.Core.Native.Mozilla.FireFoxClientPort.SendAndRead(String data, Boolean resultExpected, Boolean checkForErrors, Object[] args) at WatiN.Core.Native.ClientPortBase.WriteAndReadAsBool(String data, Object[] args) at WatiN.Core.Native.JSBrowserBase.IsLoading() at WatiN.Core.Native.JSWaitForComplete.b__0() at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc
1 func) --- End of inner exception stack trace --- at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.ThrowTimeOutException(Exception lastException, String message) at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc
1 func) at WatiN.Core.WaitForCompleteBase.WaitUntil(DoFunc`1 waitWhile, BuildTimeOutExceptionMessage exceptionMessage) at WatiN.Core.Native.JSWaitForComplete.WaitWhileDocumentNotAvailable() at WatiN.Core.FireFox.WaitForComplete(Int32 waitForCompleteTimeOut) at WatiN.Core.Element.FireEvent(String eventName, Boolean waitForComplete, NameValueCollection eventProperties)
at WatiN.Core.Element.ClickImpl(Boolean waitforComplete) at ... [our code]
...and also...
WatiN.Core.Exceptions.TimeoutException: Timeout while waiting for main document becoming available at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.ThrowTimeOutException(Exception lastException, String message) at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc
1 func) at WatiN.Core.WaitForCompleteBase.WaitUntil(DoFunc
1 waitWhile, BuildTimeOutExceptionMessage exceptionMessage) at WatiN.Core.Native.JSWaitForComplete.WaitWhileDocumentNotAvailable() at WatiN.Core.FireFox.WaitForComplete(Int32 waitForCompleteTimeOut) at WatiN.Core.Element.FireEvent(String eventName, Boolean waitForComplete, NameValueCollection eventProperties)
at WatiN.Core.Element.ClickImpl(Boolean waitforComplete) at ... [our code]
The odd thing is that it mentions JSWaitForComplete, which seems odd as that exception is from a plain link that doesn't have any attached Javascript. In our test fixtures we make sure to close the browser, so there shouldn't be stale FF instances clogging things up. Its all a bit of a mystery.
Does anyone have any suggestions for things we can try to fix this issue?
This is running WatiN 2.0 Final and Firefox 3.6.13.