# Xcode-test sometimes fails but works again after clearing cache

**URL:** <https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271>\
**Category:** Builds\
**Tags:** step, ios, xcode\
**Created:** [October 8, 2021, 1:55pm UTC](https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271 "2021-10-08T13:55:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![redryerye](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/redryerye/32/4009_2.png) [@redryerye](https://discuss.bitrise.io/u/redryerye)\
**Post date:** [October 8, 2021, 1:55pm UTC](https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271/1 "2021-10-08T13:55:01Z")

</div>

## xcode-test sometimes fail

_I’ve been using `xcode-test` on my project for a while, and running the step on [Bitrise.io](http://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](http://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](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : 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](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392)? 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](http://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](https://www.bitrise.io/cli) )? If no, can it be reproduced with Docker (using the same docker images / environment we use on [bitrise.io](http://bitrise.io))? Related guide: [Running your build locally in Docker](http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/) ._

It could not be reproduced locally.

## Build log

```auto
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](https://app.bitrise.io/build/679c72e8-7ffc-4340-bbb8-753289794b2d#?tab=log).

---

<div class="post-metadata">

**Author:** ![bdaniels](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bdaniels/32/2588_2.png) [@bdaniels](https://discuss.bitrise.io/u/bdaniels)\
**Post date:** [October 8, 2021, 4:53pm UTC](https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271/2 "2021-10-08T16:53:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)\
**Post date:** [November 3, 2021, 12:12pm UTC](https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271/3 "2021-11-03T12:12:14Z")

</div>

Hello there,

Could you let me know if the issue is still persistent? If it is, could you send us the URL of the related build and also enable Support Access on the `Settings` tab of the app ( [Enabling the Bitrise Support user for your app | Bitrise DevCenter](https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/) ) so that we can take a more in-depth look?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [December 3, 2021, 12:12pm UTC](https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271/4 "2021-12-03T12:12:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
