XCTests Failing on Physical Device: “Canceling tests due to timeout …”

前端 未结 6 1859
清酒与你
清酒与你 2021-02-01 06:33

XCTests are failing with the message: *** Canceling tests due to timeout in Waiting for test process to check in... This just started coming up in the last few days

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 07:28

    The problem lies in the fact (or rather: serious bug in xcodebuild) that the timeout for connecting to the XCTest server starts at the moment you issue the command xcodebuild. The timeout is 120 seconds, so if your compilation + startup of the simulator takes longer than 2 minutes xcodebuild will give this "Canceling tests due to timeout" error.

    The solution is to break up the build into two commands. One for building and one for running the tests:

    > xcodebuild clean build build-for-testing 
    > xcodebuild test-without-building 
    

    This will solve the timeout issue, because the test-without-building action doesn't have to compile first.

提交回复
热议问题