3

I'm running bunch of XCUItests as Fastlane job. Every time some of the tests get failed with an error "Failed to terminate com.****.****:57929".

Works fine when I run these tests directly using Xcode on simulator. Issue occurs only when I run these tests using Fastlane on Simulator. Failures happen on different tests on different time. Below is the sample code:

class ExampleTests: XCTestCase {

    var app: XCUIApplication!

    override func setUp() {

        super.setUp()
        app = XCUIApplication()
        continueAfterFailure = false
    }

    override func tearDown() {

        super.tearDown()
    }

    func testCase1() {
        app.launch()
        /* Test steps1
         step 2
         */
    }

    func testCase2() {
        app.launch()
        /* Test steps1
         step 2
         */
}

When the test executes app.launch() it tries to terminate the previous app instance and that's where its's failing. Is there a way to fix this issue? Any help is much appreciated.

  • One cannot answer this without knowing the test case and CI script you might be using – Ganesh Somani Apr 03 '19 at 05:51
  • did you find a solution for it? it is happening to me when I use iOS 15 with xcode 13.1 on Mac OS monterrey. If I use iOS 14.5 it works as exepcted – JERC Jun 16 '22 at 22:50

0 Answers0