Bitrise build works locally, but failed on at random unit tests each time

Bitrise Build Issue Report template

Description of the issue

When I run Bitrise locally it works fine, but when I did it on random unit tests failed each time and without any reasons. (Unit tests work on Xcode)


Where did the issue happen?

It happened on with the stack : Xcode 9.2.x, on macOS 10.12 (Sierra)

Which build Step causes the issue and which version of the step?

Fastlane 2.69.3


  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? Every time
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : When xcode 9 came out

Local reproduction

Locally, it works. You will find below my local setup :

  • Bitrise : 1.11.0
  • Fastlane : 2.69.3
  • Xcode : Version 9.2 (9C40b)

Build log

1 Like

Hi @JeromeCHA,

Thanks for reporting!
Checked the logs but unfortunately without the code it’s hard to say what the issue might be; I’d say it’s most likely something in your code, e.g. network requests with too low timeout or something similar.

In general I’d suggest you to check this guide How to debug your build locally / “It works on my Mac/PC but not on” - specifically the Additional notes for iOS projects section (e.g. “Make sure that you run the tests in the same simulator as the one runs.” and “please make sure to reset the iOS Simulator”).

If that wouldn’t help probably the easiest way is if you could Screen Share / Remote Desktop into the build VM and run the tests there, and see/debug what the issue might be. Note, please do Reset the Simulator there too if you run more than one test, as that’s how standard builds work; every build runs in a completely clean VM, and the VM is destroyed at the end of the build, so e.g. the iOS Simulator is always clean.

Guide for how you can connect to the MacOS Build VMs:

Please let us know how it goes or if you’d have any questions! :slight_smile:

Hi @viktorbenei,

Thank you for your answer.
I tried in a clean environment, with a clean simulator and… It didn’t work locally, lol.
It failed with the following error :

Early unexpected exit, operation never finished bootstrapping […]

I finally solved the problem by fixing some code. :slight_smile:

Thank you again for your help!

1 Like

Glad to hear you managed to reproduce it locally, and thanks for reporting! :slight_smile: