Xcode server bot failing test action because "Too many open files in system."
Asked Answered
G

2

6

The error I'm seeing is as follows:

Test target PrototypeTests encountered an error (The operation couldn’t be completed. Too many open files in system. Too many open files in system)
Test target Prototype Integration Tests encountered an error (The operation couldn’t be completed. Too many open files in system. Too many open files in system)

I am able to run the analyze and archive actions with no problems but enabling the test action causes the above errors. I've even tried this with empty tests and the problem still persists.

The output of sudo launchctl limit maxfiles on my server is:

maxfiles    256            unlimited      

Please let me know if I can provide any more information.

Granddaddy answered 22/4, 2014 at 21:34 Comment(0)
J
2

You need to increase your ulimit. You should add the line:

ulimit -n 4096

in your ~/.profile or similar.

The reason you have to add this line to your bash launch file is because just running sudo ulimit -n 4096 will only change the limit in current bash session.

Jeopardize answered 9/7, 2014 at 16:49 Comment(4)
If you want to make a system level change (at your own risk!) you need to edit the file: /etc/launchd.conf and add a line 'limit maxfiles 1000000 1000000'Jeopardize
The question was about Xcode server bots. They don't have a ~/.profile.Northbound
Yes so you have to change it at the system level as my comment indicated.Jeopardize
I've tried that on my system and I still get the same error. I don't think this is the issue anyway. The default limit of 256 is just a soft limit, the hard limit is set to unlimited.Northbound
R
0

I received this same message while trying to compile while low RAM, low disk space, and many open apps & files on my desktop. Closing most of them and emptying the trash resolved the issue.

Rost answered 21/11, 2014 at 19:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.