UI Testing Failure - App state is still not terminated

When running my tests using xcodebuild on jenkins, specific tests will randomly fail causing builds to be unstable. I am currently calling XCUIApplication().terminate() in the teardowns of all the testcases as way to fix this. However, it does not seam to work. Ive also tried cleaning the build before each jenkins build but that also does not work. Has any one had or solved this issue when working with Jenkins?

This isssue is happening to my UItesting as well.
Running Xcode Version 7.2 (7C68)

with OS X Server 5.0.15 (15S4033)


XCUIApplication does not launch when integrating remotly.

UI Testing Failure - App state is still not terminated
 
 
Q