Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - unit-tests: Test session exited(-1) without checking in

I have serious trouble with unit-tests in XCode. I use XCode 6.4 Build version 6E35b on OS X Yosemite and OS X Capitan.

As a result I have such an error:

_finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Test session exited(-1) without checking in." UserInfo=0x7fbfea2b60b0 {NSLocalizedDescription=Test session exited(-1) without checking in.} didCancel: 1

There are already some posts on stack (for instance, Xcode Server CI Bot Test Session exited(-1)), but solution was not found.

I tried to run unit-tests from XCode and from command-line, but too often I had that error. In last case I did 3 steps:

1. Deleting everything from DERIVED_DATA_PATH
2. Installing pods
3. Ran unit-tests with command: xcodebuild test -scheme UnitTests -destination 'platform=iOS Simulator,name=iPhone 5s,OS=8.2' -derivedDataPath 'temp-build-dir' 2>&1

It is a great trouble for me, because I use these tests in common automatic build flow with UI-tests and if they fail, the whole flow fails.

In release notes for XCode 6 there was information from Apple about that bug, and their workaround was to simply rerun tests. It is unacceptable for me, because they run automatically with other tests and it seems to be bad idea to rerun them until they pass or simply run without that error.

like image 201
Алексей Халайджи Avatar asked Jul 17 '15 11:07

Алексей Халайджи


1 Answers

Possible solution

Launch this command in the terminal

sudo /usr/sbin/DevToolsSecurity --enable

What is probably causing the problem

If you launched the tests not on a headless terminal you would see this dialog:

Developer Tools Access needs to take control of another process for debugging to continue. Type your password to allow this.

like image 93
Anton Avatar answered Nov 15 '22 04:11

Anton