# Too Many Open Files running Unit Tests

**URL:** <https://discuss.bitrise.io/t/too-many-open-files-running-unit-tests/23715>\
**Category:** Android\
**Tags:** android\
**Created:** [January 30, 2024, 8:29pm UTC](https://discuss.bitrise.io/t/too-many-open-files-running-unit-tests/23715 "2024-01-30T20:29:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![byates-fleetio](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@byates-fleetio](https://discuss.bitrise.io/u/byates-fleetio)\
**Post date:** [January 30, 2024, 8:29pm UTC](https://discuss.bitrise.io/t/too-many-open-files-running-unit-tests/23715/1 "2024-01-30T20:29:18Z")

</div>

During our unit test workflow we use the following gradle command to run tests.

$ /bitrise/src/gradlew “testDebugUnitTest”

The tests were working and quite stable but suddenly they began to fail 100% of the time with the following error:

2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] Caused by:  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] java.io.IOException: User limit of inotify instances reached or too many open files  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at java.base/sun.nio.fs.LinuxWatchService.(LinuxWatchService.java:62)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at java.base/sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at org.robolectric.shadows.ShadowFileObserver.(ShadowFileObserver.java:48)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at android.os.FileObserver.$$robo$init(FileObserver.java)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at android.os.FileObserver.(FileObserver.java)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at android.os.FileObserver.(FileObserver.java)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at android.os.FileObserver.(FileObserver.java)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at android.os.FileObserver.(FileObserver.java)  
2024-01-29T15:48:45.361+0000 [DEBUG] [TestEventLogger] at io.sentry.android.core.EnvelopeFileObserver.(EnvelopeFileObserver.java:38)"

Has anyone else seen this issue occur before? I tried to set the file limit higher to no avail.

---

<div class="post-metadata">

**Author:** ![birmacher](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/birmacher/32/4864_2.png) [@birmacher](https://discuss.bitrise.io/u/birmacher)\
**Post date:** [January 31, 2024, 12:33pm UTC](https://discuss.bitrise.io/t/too-many-open-files-running-unit-tests/23715/2 "2024-01-31T12:33:57Z")

</div>

Hi @byates-fleetio,

Can you please reach out to us via support and we will take a look  
[https://support.bitrise.io/hc/en-us/requests/new](https://support.bitrise.io/hc/en-us/requests/new)
