# Trying to run all tests on my app yields "too many open files" error

**URL:** <https://discuss.elastic.co/t/trying-to-run-all-tests-on-my-app-yields-too-many-open-files-error/309759>\
**Category:** Elasticsearch\
**Created:** [July 15, 2022, 5:42pm UTC](https://discuss.elastic.co/t/trying-to-run-all-tests-on-my-app-yields-too-many-open-files-error/309759 "2022-07-15T17:42:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juno](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@juno](https://discuss.elastic.co/u/juno)\
**Post date:** [July 15, 2022, 5:42pm UTC](https://discuss.elastic.co/t/trying-to-run-all-tests-on-my-app-yields-too-many-open-files-error/309759/1 "2022-07-15T17:42:42Z")

</div>

I'm building a reasonably small web app in Clojure and trying to run all the tests in order to get code coverage, but if I try to run them all, I get "too many open files" errors from elasticsearch.

I have already tried raising my system limits. I've also tried adding the JVM option "-XX:-MaxFDLimit". Neither has had an effect.

I understand that elasticsearch needs a certain number of files, but I'm confused about why it would need so many for my unit tests. Probably this means a test is behaving badly, but I'm not sure how to narrow it down, since the error doesn't occur on the same test every time.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 19, 2022, 2:01am UTC](https://discuss.elastic.co/t/trying-to-run-all-tests-on-my-app-yields-too-many-open-files-error/309759/2 "2022-07-19T02:01:22Z")

</div>

Welcome to our community! 😃

Can you please share the full error, and your elasticsearch.yml.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 16, 2022, 2:01am UTC](https://discuss.elastic.co/t/trying-to-run-all-tests-on-my-app-yields-too-many-open-files-error/309759/3 "2022-08-16T02:01:36Z")

</div>

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