Running UITests on VS for Mac fails halfway randomly (Xmarin.Forms - iOS project)

Hey all, I'm trying to run my UITests in Visual Studio for Mac with the iOS Simulator.

Xcode : Version 10.0 (10A255)
Visual Studio for Mac: Version 7.6.10 (build 27)
Runtime:
Mono 5.12.0.309 (2018-02/39d89a335c8) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

When I run the tests individually everything works fine, but when I try using the "Run All" button in the test panel, the tests are failing randomly (some are passing while others not unexpectedly) with the following exception in the Output log:

Exception: System.AggregateException: One or more errors occurred. ---> Xamarin.UITest.XDB.Exceptions.DeviceAgentException: DeviceAgent touch failed: An error occurred while sending the request ---> System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: ConnectFailure (Connection refused) ---> System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x0003b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs:134
at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/System/System.Net.Sockets/Socket.cs:1145
at System.Net.Sockets.SocketTaskExtensions+<>c.b__2_1 (System.IAsyncResult asyncResult) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs:35
at System.Threading.Tasks.TaskFactory1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func2[T,TResult] endFunction, System.Action1[T] endAction, System.Threading.Tasks.Task1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:554
--- End of stack trace from previous location where exception was thrown ---

All the UITests are working fine in Android runtime, but only on iOS when I attempt to "Run all" functionality, things are acting weird.
This just doesn't make sense.

Any suggestions? :)

Sign In or Register to comment.