Bitrise build works locally, but failed on Bitrise.io 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 Bitrise.io random unit tests failed each time and without any reasons. (Unit tests work on Xcode)

Environment:

Where did the issue happen?

It happened on Bitrise.io 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

Reproducibility

  • 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

https://drive.google.com/file/d/1JT52K_G4HejcadhOFqN14Dyd_ZHOMhpS/view?usp=sharing
https://drive.google.com/file/d/1fiUy2GOP6JFk33wOCs5TOPNMoriCklW4/view?usp=sharing

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 bitrise.io” - specifically the Additional notes for iOS projects section (e.g. “Make sure that you run the tests in the same simulator as the one bitrise.io 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 bitrise.io 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: https://gist.github.com/viktorbenei/c6d4fe1e68de739dbb5f4f15de76b9db

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: