Xcode Server CI Bot Test Session exited(-1)
Asked Answered
K

2

13

I am getting an error when trying to run tests on XcodeServer against simulator devices. The tests sometimes pass for one device and fail for another, but the failing device is not always the same one. This can happen in a single session.

The log file error is as follows:

2015-03-23 10:44:11.029 Initializing test infrastructure.
2015-03-23 10:44:11.029 Writing testing status log to /Library/Developer/XcodeServer/Integrations/Integration-7e6e54f21a2fd25cddc9df0436cb3688/Session-2015-03-23_10:44:10-tH1BD4.log.
2015-03-23 10:44:28.676 Launch session started, setting a disallow-finish-token on the run operation.
2015-03-23 10:44:30.352 Adding console adaptor for test process.
2015-03-23 10:44:39.566 Creating the connection.
2015-03-23 10:44:39.567 Listening for proxy connection request from the test bundle (all platforms)
2015-03-23 10:44:39.567 Resuming the connection.
2015-03-23 10:44:39.567 Test connection requires daemon assistance.
2015-03-23 10:44:39.568 Checking test manager availability..., will wait up to 120s
2015-03-23 10:45:05.253 testmanagerd handled session request.
2015-03-23 10:45:05.254 Waiting for test process to check in..., will wait up to 120s
2015-03-23 10:46:47.578 Test operation failure: Test session exited(-1) without checking in.
2015-03-23 10:46:47.645 _finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Test session exited(-1) without checking in." UserInfo=0x7f8be43e40c0 {NSLocalizedDescription=Test session exited(-1) without checking in.} didCancel: 1

Any ideas would be really helpful.

Kristenkristi answered 23/3, 2015 at 11:5 Comment(2)
Did you find a solution? I'm also having the same problem and can't find any informative logCracy
Not really. It's stopped happening but I can't explain why. We upgraded to the latest version of Xcode and OS X Server, and also made sure we implemented teardown incase something was hanging. So far it's been ok.Kristenkristi
M
2

The simulator requires a user GUI context to run. If the server is launched from /Library/LaunchDaemons then it's running in the system (root) context and doesn't have a GUI context. This is a problem if using Atlassian Bamboo as well as Jenkins for CI. Facebook devs have also encountered this problem with xctool.

You may need to launch the XcodeServer from a user context, i.e. create a plist file in ~/Library/LaunchAgents, and have that user continuously logged in. I would think Apple would have that problem solved during installation.

Maneating answered 10/8, 2015 at 17:33 Comment(1)
And also check that in LaunchAgents you allow it to run in GUI session actually. I added <key>LimitLoadToSessionType</key><string>Aqua</string> to that launchd.plist and got it working!Grati
K
1

Try launching this command on the server:

sudo /usr/sbin/DevToolsSecurity --enable

some more details in this answer

Kellby answered 6/8, 2015 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.