Sometimes while running my UI tests, I get the following error
Lost connection to test manager services. No logs or anything. Happens randomly. I would provide more information but I just don’t have it because of the nature of the error.
Using Xcode 7 beta 5.
The error appear for every async operations made in tests. It can be:
- Operation on non existing object
- Network operations with wrongly assign block handler
I was getting the same error when running UI tests written in Swift. It turned out that the memory usage was increasing constantly when running a longer test (no memory release). When memory had been exhausted, the device “Lost connection to test manager services.”
The solution? Using ‘autoreleasepool’ in its Swift version, in proper places.