Too Many Open Files running Unit Tests

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.

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