Comment 1 for bug 1037433

Revision history for this message
Vincent Ladeuil (vila) wrote :

FTR, we had similar issues with bzr on windows and osx, one cause was tests opening files but never closing them.

I.e. stuff like:

   f = open('xxx', 'w')
   f.write('tagada')

or

   content = open('xxx').read()

were fixed by doing:

   with open('xxx') as f:
     f.write('tagada')

or

  with open('xxx') as f:
     content = f.read()

Also, 'Too many open files' is also raised on osx when sockets are not timely closed.

Since this kind of leaks is tedious to track down, we worked around the issue for quite some time by running tests in parallel. I..e the test suite is split and processes are launched to run a subset. This spreads the leaks across multiple processes allowing more tests to be run... until a subset hits the limit again of course.