fastlane: Test target x encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)

New Issue Checklist

Issue Description

We have 3 separate build machines all which run the same code, I am getting this error on the newest mac we just got which has the same specs as another which the builds pass on. All running exact same fastfile etc. I assume something must be up with my build on the computer. All are running xcode 8.1.

Complete output when running fastlane, including the stack trace and command used
Executed 619 tests, with 0 failures (0 unexpected) in 22.376 (22.746) seconds
2016-11-10 09:54:04.256 xcodebuild[40376:613510] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

Testing failed:
	Test target x encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

Environment

Please run fastlane env and copy the output below. This will help us help you 👍 If you used --capture_output option please remove this block - as it is already included there.

| Gem                 | Version | Update-Status |
| ------------------- | ------- | ------------- |
| credentials_manager | 0.16.2  | âś… Up-To-Date  |
| fastlane_core       | 0.55.0  | âś… Up-To-Date  |
| spaceship           | 0.37.0  | âś… Up-To-Date  |
| deliver             | 1.15.0  | âś… Up-To-Date  |
| snapshot            | 1.16.3  | âś… Up-To-Date  |
| frameit             | 3.0.0   | âś… Up-To-Date  |
| pem                 | 1.4.0   | âś… Up-To-Date  |
| cert                | 1.4.4   | âś… Up-To-Date  |
| sigh                | 1.11.2  | âś… Up-To-Date  |
| produce             | 1.3.0   | âś… Up-To-Date  |
| gym                 | 1.12.0  | âś… Up-To-Date  |
| pilot               | 1.12.0  | âś… Up-To-Date  |
| scan                | 0.14.1  | âś… Up-To-Date  |
| supply              | 0.7.1   | âś… Up-To-Date  |
| match               | 0.11.0  | âś… Up-To-Date  |
| fastlane            | 1.108.0 | âś… Up-To-Date  |
| screengrab          | 0.5.5   | âś… Up-To-Date  |


### Loaded fastlane plugins:

**No plugins Loaded**


<details><summary><b>Loaded gems</b></summary>

| Gem                       | Version      |
| ------------------------- | ------------ |
| executable-hooks          | 1.3.2        |
| bundler-unload            | 1.0.2        |
| rubygems-bundler          | 1.4.4        |
| bundler                   | 1.13.3       |
| highline                  | 1.7.8        |
| commander                 | 4.4.0        |
| terminal-table            | 1.4.5        |
| multipart-post            | 2.0.0        |
| faraday                   | 0.9.2        |
| faraday_middleware        | 0.10.0       |
| dotenv                    | 2.1.1        |
| net-ssh                   | 3.2.0        |
| net-sftp                  | 2.1.2        |
| plist                     | 3.1.0        |
| rubyzip                   | 1.1.7        |
| security                  | 0.1.3        |
| krausefx-shenzhen         | 0.14.11      |
| slack-notifier            | 1.5.1        |
| rouge                     | 1.11.1       |
| xcpretty                  | 0.2.4        |
| addressable               | 2.4.0        |
| claide                    | 1.0.1        |
| xcode-install             | 2.0.7        |
| word_wrap                 | 1.0.0        |
| multi_json                | 1.12.1       |
| colored                   | 1.2          |
| babosa                    | 1.0.2        |
| gh_inspector              | 1.0.2        |
| credentials_manager       | 0.16.2       |
| fastlane_core             | 0.55.0       |
| multi_xml                 | 0.5.5        |
| unf_ext                   | 0.0.7.2      |
| unf                       | 0.1.4        |
| domain_name               | 0.5.20160826 |
| http-cookie               | 1.0.3        |
| faraday-cookie_jar        | 0.0.6        |
| fastimage                 | 1.6.8        |
| mini_magick               | 4.5.1        |
| xcpretty-travis-formatter | 0.0.4        |
| i18n                      | 0.7.0        |
| thread_safe               | 0.3.5        |
| tzinfo                    | 1.2.2        |
| activesupport             | 4.2.7.1      |
| json                      | 1.8.3        |
| excon                     | 0.54.0       |
| xcodeproj                 | 1.3.3        |
</details>


*generated on:* **2016-11-11**
</details>

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 48 (10 by maintainers)

Most upvoted comments

Bad news, my only solution was to completely re-install the OSX. That worked. I’m all set

Update: It’s back. Lord help us.

I also ran into this issue with Xcode 8.3.2 using Cocoapods and the latest fastlane. Following these notes helped solving the issue! All I had to do is add $(FRAMEWORK_SEARCH_PATHS) to the LD_RUNPATH_SEARCH_PATHS of the test targets

Actually this was not at all related to the discussion here. Same symptom - I saw Error Domain=IDETestOperationsObserverErrorDomain but as it turned out, this was from a crash right on launch in the application stack that we were able to get fixed. Unfortunately, I assumed this was fastlane - since I had just upgraded to the new release. Always check the device log!

I had this issue occur, but mine might be a little different. I’ll list my issue and solution in case it might help you out. I had a test bundle with empty test. Whenever scan ran on it, it would just timeout there.

  • What i did was disable the bundle.
  • Before running any test, i would boot up the simulator first, then wait to give it time to load.
  • Then clean out any previously install app on it. Then run scan.

What’s the status on this ongoing issue? Lots of people still seeing this issue I guess (including me).

In my case, specifying iPhone and iOS version helped. (make sure that simulator with chosen version is installed)

fastlane scan --scheme "integration" --device "iPhone 7 (10.2)" --clean

This is happening to me as well. It seems to start happening right after I updated to Swift 4 / Xcode 9. Not sure if running multiple simulators affects it or not. I am using TeamCity on a Mac mini macOS 10.12.

Using fastlane v2.59.0 Here is the output:

[13:36:19]	[Step 1/1] 2017-09-29 13:36:13.378 xcodebuild[50763:4063673] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
[13:36:19]	[Step 1/1]
[13:36:19]	[Step 1/1] Testing failed:
[13:36:19]	[Step 1/1] Early unexpected exit, operation never finished bootstrapping - no restart will be attempted
[13:36:19]	[Step 1/1] ** TEST FAILED **
[13:36:19]	[Step 1/1] [13:36:19]: Exit status: 65```

This seems to be happening on Bitrise for my team as well. It’s fairly random (although some days it’s around 50% of the time for PRs), and most of the time if I re-run the build, I can get it to run successfully.

Stack: Xcode 8.3.x, on macOS 10.12 (Sierra) (full details)

Log output:

 Running script '[CP] Embed Pods Frameworks'
â–¸ Running script '[CP] Copy Pods Resources'
â–¸ Touching MyAppTests.xctest
â–¸ Signing /Users/vagrant/Library/Developer/Xcode/DerivedData/MyApp-goyjtmivxnatifgxjovyfpyikszp/Build/Products/Debug-iphonesimulator/MyAppTests.xctest
2017-09-25 12:08:27.500 xcodebuild[2493:12978] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
Testing failed:
Test target MyAppTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **
[12:08:27]: Exit status: 65

Proposed fixed don’t seem to work. Is this still a problem for someone?

I recently had the problem where a number of builds failed because the simulator could not be communicated with.

I started running this script before using fastlane scan - to kill the simulator and wipe it clean. It has eliminated much of these errors. It still happens occasionally but much less frequently.

echo "Shutting down the simulator app"
osascript -e 'quit app "Simulator"'

echo "Making sure ALL simulators are shutdown"
xcrun simctl list | grep Booted | grep -e "[0-9A-F\-]\{36\}" -o | xargs xcrun simctl shutdown

echo "Erasing apps from all simulators and resetting back to clean state"
xcrun simctl erase all

echo "Killing com.apple.CoreSimulator.CoreSimulatorService"
killall -9 com.apple.CoreSimulator.CoreSimulatorService

Hallo,

i got the same error now on two machines (10.11 and 10.10). First it worked correctly. I only use snapshot.

Resetting & Deleting of the simulators does not fix the the problem.

Also having this issue on Travis after updating osx_image to Xcode 9.1 Everything was working fine on Xcode 8.2 image.

EDIT: I have made 2 changes and the build has finally passed.

  1. I applied @kohol’s answer to my project by addeding device: "iPhone 7 (10.2)" to scan options in my Fastfile.
  2. I also moved ENV["FASTLANE_EXPLICIT_OPEN_SIMULATOR"] = "2" from my test lane to before_all lane.

Any suggestions to get this issue fixed? We are receiving the following error on every CI run. Had Xcode 8.3.3, switched to Xcode 9 and swift4 but then reverted to old xcode is when we started seeing the following issue: any pointers?

xcodebuild[79910:1503189] Error Domain=IDETestOperationsObserverErrorDomain Code=6 “Early unexpected exit, operation never finished bootstrapping - no restart will be attempted” UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

Testing failed: Test target xx encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted) ** TEST FAILED **

I tend to have the simulator up and running first before any test is run. Can you try to put this in your fastfile:: ENV[“FASTLANE_EXPLICIT_OPEN_SIMULATOR”] = “2”

I’ve seen this error and tracked it down to different problems each time (none with Fastlane):

  • A crash when the app initially starts up on the simulator; this is actually a great error to find if you running tests on a PR - will prevent developers from committing this crash.
  • The app could not be loaded because a library was missing (example: Library not loaded: @rpath/libswiftXCTest.dylib). I had to set Runpath to include @loader_path/Frameworks and then it was able to load this library.
  • A communication channel error: Connection peer refused channel request for “dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface”; channel canceled. I am not sure what the solution to this one is - however I have seen something like this on my own computer running tests on the simulator - occasionally it cannot connect. Restarting the simulator or even my computer itself will fix it. Would love to know a better way.

I had this and fixed it by deleting an empty test target as mentioned by someone above.

It just started happening to me on my Jenkins build slaves tonight. After I upgraded to fastlane 2.22.0.

On my own dev computer fastlane scan runs my tests just fine.

Hello to all.

I got the same error with fastlane scan. I spent many hours before found the problem. Maybe someone will get the same.

The real bug is not the Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. Before this message I found in logs the another message, more important: Cannot launch simulated executable: no file found at /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gltkodapbbvlitfeuqbhsjilahgz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/MyApp.app

Here is a full example:

13:44:14 /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gltkodapbbvlitfeuqbhsjilahgz/Logs/Test/9F2E8733-A6AE-4AD3-8BE6-D4BB5A70D6E8/Session-MyAppTests-2017-03-06_154355-xpXd2q.log

13:44:14 2017-03-06 15:43:55.242 xcodebuild[20233:269415] Error Domain=IDEFoundationErrorDomain Code=1 "Cannot launch simulated executable: no file found at /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gltkodapbbvlitfeuqbhsjilahgz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/MyApp.app" UserInfo={NSLocalizedDescription=Cannot launch simulated executable: no file found at /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gltkodapbbvlitfeuqbhsjilahgz/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/MyApp.app}

13:44:14 2017-03-06 15:43:55.242 xcodebuild[20233:269415] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
13:44:14 ** TEST EXECUTE FAILED **

When I looked into the Session-MyAppTests-2017-03-06_154355-xpXd2q.log I found the launch command, something like this:

/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -destination "platform=iOS Simulator,id=FA7DF862-A049-47C5-93B7-070483AA7B33" -derivedDataPath /Users/me/Library/Developer/Xcode/DerivedData/MyApp-eleawdbfycuswrcieexbehcqpbef clean test-without-building

Then I realized that something strange in the end of string: test-without-building — this is the real problem! But why? Because my .env config contained incorrect value of the SCAN_TEST_WITHOUT_BUILDING=0 environment variable. The strangest fix that I could imagine… ta-da-a: SCAN_TEST_WITHOUT_BUILDING=false. Yep, zero value is not equal false in Ruby.