# Xcode-test still fails in some occasions

**URL:** <https://discuss.bitrise.io/t/xcode-test-still-fails-in-some-occasions/19395>\
**Category:** Builds\
**Tags:** step, xcode, test\
**Created:** [February 16, 2022, 6:45am UTC](https://discuss.bitrise.io/t/xcode-test-still-fails-in-some-occasions/19395 "2022-02-16T06:45:48Z")\
**Posts on this page:** 3\
**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:** [February 16, 2022, 6:45am UTC](https://discuss.bitrise.io/t/xcode-test-still-fails-in-some-occasions/19395/1 "2022-02-16T06:45:48Z")

</div>

Continuing the discussion from [Xcode-test sometimes fails but works again after clearing cache](https://discuss.bitrise.io/t/xcode-test-sometimes-fails-but-works-again-after-clearing-cache/18271/3):

## xcode-test still fails in some occasions

_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._

It still happens in xcode-test v4.0.2

## 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.2

- 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.2 / 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: [http://devcenter.bitrise.io/docker/run-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/780ef8b9-5f84-4a8f-b9b1-6102398f82cb#?tab=log).

---

<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:** [March 18, 2022, 6:46am UTC](https://discuss.bitrise.io/t/xcode-test-still-fails-in-some-occasions/19395/2 "2022-03-18T06:46:02Z")

</div>

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

---

<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:** [July 18, 2022, 12:20pm UTC](https://discuss.bitrise.io/t/xcode-test-still-fails-in-some-occasions/19395/3 "2022-07-18T12:20:39Z")

</div>

Hello @redryerye 👋

From your report it seems like something accumulates in the cache that causes the build to fail, but it’s hard to say wether this is due to a change in code, or an environmental issue.  
If this still persists, could you please send a recent build URL to [https://support.bitrise.io/](https://support.bitrise.io/) , with Support Access enabled?
