_XCTFailInCurrentTest should only be called during a test

Now I am doing UITesting with Xcode, and I got this error.

* Validation error in void _XCTFailInCurrentTest (NSString *, ...) (), /Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-10112/XCTestFramework/Classes/XCTestCase.m:63 2016-05-13 22: 31: 54.961 XCTRunner [15428: 168507] * Application termination due to the uncaught exception "NSInternalInconsistencyException", reason: '_XCTFailInCurrentTest should be called only during the test. Failure Description: Failed to get completion for

I saw another similar entry here.

Cannot start Xcode (7.3) user interface tests in Jenkins

I use Jenkins, but at the moment I'm directly starting from Xcode, and I can’t even work with Xcode. How should I do it?

+4
source share
3 answers

Background

  • I ran into this problem in Xcode 7.3 (7D175) and iOS Simulator 9.3.
  • Symptoms were as follows.
    • Test Runner starts normally and exits.
    • After that, the tested application never starts.
    • (if the test application has not been installed, Xcode will also never install the application before starting the test).
    • (A side symptom is that the recording also doesn't work for me - I took inspiration from this SO post.)

After 30 seconds, the test expires with:

XCTRunner[36260:489138] Continuing to run tests in the background with task ID 1    
2016-05-18 16:17:25.720 XCTRunner[36260:489138] *** Assertion failure in void _XCTFailInCurrentTest(NSString *, ...)(), /Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-10112/XCTestFramework/Classes/XCTestCase.m:63
2016-05-18 16:17:25.723 XCTRunner[36260:489138] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '_XCTFailInCurrentTest should only be called while a test is running.
Failure description: Failed to receive completion for <XCDeviceEvent:0x7fddc241f970 page 12 usage 64 duration 0.01s within 30.0s'

The fix that worked for me was:

  • reset .
  • , ​​ iOS 9.x . ( iOS 8)
  • , .

Xcode , .

+4

- . - , - . reset (Menu Simulator | Reset ...) .

0

We tried tips from other answers that did not work for us.
A full reinstall of Xcode 7.3 fixed our problem.

  • remove Xcode
  • reboot
  • reinstall xcode
  • success
0
source

All Articles