Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
seanscal opened this issue Nov 11, 2016 · 48 comments

Comments

@seanscal
Copy link
Contributor

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>
@TKBurner
Copy link

@seanscal Can you erase the simulators on the machine in question? That should clear this up in most cases. Thanks!

@seanscal
Copy link
Contributor Author

seanscal commented Nov 16, 2016

@TKBurner this has just started happening with one of the other builds on different machines as well. It happens every time on the one machine with all of our builds that run tests, and then sporadically is happening on the other machines as well now within the last two or three days

@seanscal
Copy link
Contributor Author

seanscal commented Nov 16, 2016

also, do you mean reset all the simulators or uninstall then reinstall, I've tried both on the originally failing machine

@TKBurner
Copy link

@seanscal Is it occurring more on a slower machine? It looks like a timeout of some sort. Thanks!

@lam2558
Copy link

lam2558 commented Nov 21, 2016

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.

@seanscal
Copy link
Contributor Author

seanscal commented Dec 7, 2016

@TKBurner sorry i dont know why I didnt see this, but this is a early 2015 macbook that we run builds on which is faster than one other one and should be about the same speed as our third. I'm not sure why timeouts would happen on this and not the slowest machine, where jenkins builds take like 12 minutes, while on these 2 they take around 4-5

@lam2558 thanks for the help, but I dont think it applies to my situation sadly :(.

@Christian1313
Copy link

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.

@seanscal
Copy link
Contributor Author

seanscal commented Jan 5, 2017

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.

@KIVagant
Copy link

KIVagant commented Mar 6, 2017

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.

@RichardGuion
Copy link

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.

@wolffan
Copy link
Contributor

wolffan commented Mar 23, 2017

I got it on a scan step on Travis ... I assume was simulator. But leaving here for info:

2017-03-22 19:29:46.165 xcodebuild[1687:7465] 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 <DeletedName> encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **
[19:29:50]: Exit status: 65

@RichardGuion
Copy link

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!

@torstenlehmann
Copy link

For us it was caused either by Xcode asking for debugging permission credentials or because we had to deselect code coverage in the scheme, save and select code coverage again. So not exactly sure which one solved it.

@JamesKuang
Copy link

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

@freak4pc
Copy link
Contributor

freak4pc commented May 1, 2017

I'm seeing this issue when trying to set up Travis for RxStarscream. No fastlane so it is definitely not fastlane specific. I'm really not sure what it is, I've tried everything and running the command locally works absolutely fine.

https://travis-ci.org/freak4pc/RxStarscream/builds/227625861

https://github.com/freak4pc/RxStarscream/blob/feature/travis-ci/.travis.yml

@RichardGuion
Copy link

RichardGuion commented May 1, 2017

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.

@mgrebenets
Copy link
Collaborator

mgrebenets commented May 15, 2017

This issue just started happening for me, but there are things that puzzle me

  • The issue started happening on existing project
  • The project was using fastlane scan for at least a year and this issue was extremely rare
  • After I removed 1 file from the project and added 1 pod to it, the issue now happens every run
  • It occurs both on my local machine as well as on CI
  • We have a handful of CI build agents, and so far it happened on 4 of them at least
  • The version of fastlane is 2.12.0 and this version as used with this project for a long time, at least 3 months or so

I can see that simulator is launching and then has a spinner like so:
image

And while it spins and is booting, the tests fail with 65 error code.

2017-05-15 23:41:44.993 xcodebuild[23689:289454] 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}
2017-05-15 23:41:45.008 xcodebuild[23689:289986] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7fabacac4510>


Testing failed:
Test target X encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **
[23:41:45]: Exit status: 65

By that time the simulator finishes launching animation and loads the Home screen.

@mgrebenets
Copy link
Collaborator

mgrebenets commented May 15, 2017

Update, just tried with fastlane 2.30.2 - same issue.

It's as if the project somehow builds super fast and tries to run tests before simulator is ready.

Like I said, this issue was occasional for us across multiple Xcode projects.
Maybe 1 in 10 or even 1 in 20 runs, I would say.

Now with this one particular project and specific project change it is reliably reproducible on CI agents and on my laptop as well.

For some reason scan neither waits for simulator to get ready nor does it retry to run the tests at least few more times.

Xcode that I'm using is

Xcode 8.2.1
Build version 8C1002

@lam2558
Copy link

lam2558 commented May 15, 2017

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"

@RichardGuion
Copy link

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

@mgrebenets
Copy link
Collaborator

@lam2558 thanks for suggestion, though that didn't make any difference
@RichardGuion

I'm using something similar:

def kill_simulators
  Action.sh("killall -9 Simulator 2>/dev/null || echo No simulators running")
end

and then using FastlaneCore::Simulator to reset things:

    # Reset simulator
    if Env.reset_simulator?
      puts "Reset simulator: iOS #{CIConfig.full_test_device_name}"
      FastlaneCore::Simulator.reset(name: CIConfig.test_device_name, os_version: CIConfig.test_device)
      kill_simulators # Kill simulators again (otherwise builds may get stuck)
    end

Probably the logic to reset simulator is missing some bits...

Anyways, I've tried the steps you have suggested.

The main difference is that now the tests fail with the same error, while simulator is showing progress bar, not a spinner :)

image

@mgrebenets
Copy link
Collaborator

So, maybe it helps to narrow it down.

In my case adding new pod to main target is what's causing the issue.
Some facts:

  • Mix-n-match dynamic framework project (ObjC + Swift)
  • No pods for main target until making the change
  • Added pod is Swift Result pod version 3.2.1
  • After adding the pod I can't run unit tests in Xcode either and getting this error:
    image

So at least in my case, failing tests from command line seem to be same as in Xcode.

@mgrebenets
Copy link
Collaborator

OK, so in the end solution for my trouble was re-integrating cocoapods.

pod deintegrate then pod install.

I've noticed that doing so changes some of the CocoaPods autogenerated files, such as "copy frameworks" shell script and few other xcconfigs.

This may not be the case if you don't use cocoapods though...

@taquitos
Copy link
Collaborator

@mgrebenets Xcode 8.2.1 wasn't kind to us, are you still seeing issues using the most current fastlane and Xcode 8.3.2?

@ffittschen
Copy link
Contributor

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

@ghost ghost mentioned this issue Jul 13, 2017
2 tasks
@MarkMolina
Copy link

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

@ranganathagv
Copy link

I too had the same problem when creating xcodebuild test from Jenkins.

I Fixed the problem by manually do test from Xcode and then run the xcodebuild trest command/script from Jenkins . I was using Xcode 9 beta version. Try it out comment if this solution works for you guys

@dlo
Copy link
Contributor

dlo commented Aug 11, 2017

Fix doesn't appear to work for me either.

@MetaImi
Copy link

MetaImi commented Sep 6, 2017

For me the problem was that the test target was not running locally either, because of missing cocoapods framework

@ryang1428
Copy link

ryang1428 commented Sep 12, 2017

My team has been running into this issue quite a bit on our Jenkins builds. We have to constantly restart the simulators, then the builds until they pass.

▸ Signing /Users/jenkins/Library/Developer/Xcode/DerivedData/MyApp-gphbozbacuetrndikqwmbtmhnxes/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/iosapp.app/PlugIns/MyAppTests.xctest
2017-09-12 09:36:04.069 xcodebuild[73993:6233540] 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 **
ERROR [2017-09-12 09:36:11.01]: Exit status: 65
/Users/jenkins/.gem/gems/fastlane-2.55.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `build_failure!': [!] Error building the application - see the log above (FastlaneCore::Interface::FastlaneBuildFailure)
	from /Users/jenkins/.gem/gems/fastlane-2.55.0/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing'

@ohayon
Copy link
Contributor

ohayon commented Sep 12, 2017

Hey @ryang1428 what version of Xcode are you using?

@coolbnjmn
Copy link

coolbnjmn commented Sep 20, 2017

This is occurring to me as well, using Xcode 8.3.3 on a mac mini in the cloud. Xcode server consistently fails as a result of this issue.

Edit:
This is also occurring for my team on CircleCI randomly now.

@JakeSc
Copy link

JakeSc commented Sep 23, 2017

This seems to have started occurring once we added multiple test sub-targets to the test scheme.

@ryang1428
Copy link

ryang1428 commented Sep 25, 2017

Sorry @ohayon I just saw your reply-- but we are seeing this on Xcode 8.3.3. I will get a more detailed log up next time I see this

@aarons22
Copy link

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

@lewiguez
Copy link

Not sure if this helps or not, but I was getting a similar error (code 1 instead of 6) and digging down into the system logs provided a lot more context. Whenever the build was running, I checked the device under "Devices" in Console.app on the box. I found out an architecture was missing in the build and it was causing trouble. Updating my build products and scheme solved the issue for me.

@ryang1428
Copy link

Its been happening several times a day this week:

▸ Signing /Users/jenkins/Library/Developer/Xcode/DerivedData/WhiteLabelClient-elfzwalyuregzmcqaqtuwmdvsygb/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/WhiteLabelClient.app/PlugIns/WhiteLabelClientTests.xctest
2017-09-27 16:20:21.421 xcodebuild[41567:1873091] 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 WhiteLabelClientTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **
ERROR [2017-09-27 16:20:21.81]: Exit status: 65
/Users/jenkins/.gem/gems/fastlane-2.59.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `build_failure!': [!] Error building the application - see the log above (FastlaneCore::Interface::FastlaneBuildFailure)
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/error_handler.rb:24:in `handle_build_error'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/runner.rb:42:in `block in test_app'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/fastlane_core/lib/fastlane_core/command_executor.rb:88:in `execute'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/runner.rb:34:in `test_app'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/runner.rb:14:in `run'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/manager.rb:14:in `work'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/commands_generator.rb:40:in `block (2 levels) in run'
	from /Users/jenkins/.gem/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call'
	from /Users/jenkins/.gem/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in `run'
	from /Users/jenkins/.gem/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in `run_active_command'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:64:in `run!'
	from /Users/jenkins/.gem/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in `run!'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/commands_generator.rb:59:in `run'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/scan/lib/scan/commands_generator.rb:11:in `start'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/fastlane/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'
	from /Users/jenkins/.gem/gems/fastlane-2.59.0/bin/fastlane:20:in `<top (required)>'
	from /Users/jenkins/.gem/bin/fastlane:22:in `load'
	from /Users/jenkins/.gem/bin/fastlane:22:in `<main>'

Xcode 8.3.3
This is using scan 2.59.0

@SeanRobinson159
Copy link

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```

@tarumalik
Copy link

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 **

@konradholub
Copy link

konradholub commented Oct 12, 2017

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

@dzzh
Copy link

dzzh commented Nov 8, 2017

I had this problem when running tests on iOS 9 simulator (Xcode 9, parallel run with iOS 10 simulator). After we decided to drop iOS 9 tests and only run the suite for iOS 10 and iOS 11, the problem was gone.

@rb-mica
Copy link

rb-mica commented Nov 22, 2017

I had this problem when I had both Xcode 9.0 and 9.1 one installed and the simulator that was chosen is not displayed in the latest Xcode (something weird there) so I ran xcrun simctl delete <UUID> and the issue was resolved.

@MarkMolina
Copy link

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

@Fengson
Copy link

Fengson commented Nov 27, 2017

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.

@ghost
Copy link

ghost commented Dec 1, 2017

Ok, so creating a naked project with file > new project > include unit tests > cmd + u works just fine.

Started adding source files from my broken project, one at a time, to the new naked project. I also started adding framework dependencies one at a time.

I reproduced the problem the moment I introduced a specific framework.

The framework was built with Carthage. The Carthage documentation states a few steps that I normally skip. Now it seems, these steps are important.

The following solved my issue.

screen shot 2017-12-01 at 10 29 32

@SeanRobinson159
Copy link

I applied @rob-nash's answer to my project, but I am still having the same problem, no results on success or failure of UI tests.
But now I cut down on a build script that would "thin" my frameworks, so that was helpful. Thanks!

@ohayon
Copy link
Contributor

ohayon commented Dec 4, 2017

Hey everyone, as you can see this issue was started over a year ago. I am going to close this issue and if anyone sees something similar to this, I think it would be best to open a new issue so that we can make sure that everything is up to date and we aren't conflating some things that might be caused by different problems given how much code has changed in the past 365+ days 😄 🚀 🐙

@ohayon ohayon closed this as completed Dec 4, 2017
@kamwysoc
Copy link

kamwysoc commented Feb 2, 2018

I was getting the same error while running scan on our CI agent, and also locally on my machine.
Log file only contains an information like:

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}
[07:59:58]	[Step 2/2] Testing failed:
[07:59:58]	[Step 2/2] Early unexpected exit, operation never finished bootstrapping - no restart will be attempted

👉 Finally running test target via Xcode 9.2 helped me!

Here are the steps which help me to fix the problem:

👉 1. Run all tests using Xcode. (What is important here, that only Xcode return a detailed error. I also try to run unit test AppCode, but unfortunately, it ended up without meaningful error)

👉 2. In my case it occurs that while Xcode runs the tests I will receive a runtime error:

Main Thread Checker: UI API called on a background thread: -[UIApplication setApplicationIconBadgeNumber:]

Here is my code when I started receiving Early unexpected exit error.

UNUserNotificationCenter.current().getPendingNotificationRequests {
            (v: [UNNotificationRequest]) in
            UIApplication.shared.applicationIconBadgeNumber = 0
}

and code before the error:

UIApplication.shared.applicationIconBadgeNumber = 0 // I called this line on the main thread 

So, as Xcode said I called the setter of applicationIconBadgeNumber not on the main thread. After fixing that and calling the UIApplication.shared.applicationIconBadgeNumber = 0 on main thread my scan start working fine and without Early unexpected exit error

Summary:

I guess in your case it could be a different error, but it is worth to run unit tests using Xcode because(in my case) that was only one way to get a detailed error.

Hope it will help you 😉

@fastlane fastlane locked and limited conversation to collaborators Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests