Xcode-test sometimes fails but works again after clearing cache

xcode-test sometimes fail

I’ve been using xcode-test on my project for a while, and running the step on Bitrise.io sometimes fails, even though the step succeeds when running locally. When I clear cache from Settings, it works again.

Environment:

Where did the issue happen?

On Bitrise.io (Stack: Xcode 13.0.x)

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

xcode-test v4.0.0

  • Destination: platform=iOS Simulator,name=iPhone 8 Plus,OS=latest
  • xcodebuildVersion: Xcode 13.0 (Build version 13A233)

However, this issue has been existing for a while, prior to xcode-test v4.0.0 / XCode 13.0.

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. : YES
  • Does the issue happen sporadically, or every time? Sporadically
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : I do not remember, but I think the first time I encountered was late 2020.

Local reproduction

Can it be reproduced on your own Mac/PC by following our local debug guide? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what bitrise.io will get when it does a git clone in the clean environment! If possible please note which sections you tried.

It could not be reproduced locally.

Local reproduction: Linux / Android (docker based) stack builds

Can it be reproduced by running the build locally, after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( Bitrise CLI )? If no, can it be reproduced with Docker (using the same docker images / environment we use on bitrise.io)? Related guide: http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/ .

It could not be reproduced locally.

Build log

Testing failed:
	FooTests:
		The test runner encountered an error (Failed to establish communication with the test runner. If you believe this error represents a bug, please attach the result bundle at /var/Bar/Test.xcresult. (Underlying Error: Error retrieving daemon unix domain socket from simulator, failed after 30 attempts.; getenv error: Error Domain=com.apple.CoreSimulator.SimError Code=405 "Unable to getenv("TESTMANAGERD_SIM_SOCK") while not booting or booted.  Current state: Shutdown" UserInfo={NSLocalizedDescription=Unable to getenv("TESTMANAGERD_SIM_SOCK") while not booting or booted.  Current state: Shutdown}))

I have enabled Support access on my app.
To see the log, please look this build.

I’m having a similar issue but with Xcode 12.5.1. Tests suddenly started failing. I’ll try clearing the cache and see what happens.

Update: clearing the cache did not help in my case