[Tests] Increase file descriptor limit

Increase the file descriptor limit to avoid 'Too many files open'
error when running tests.
This commit is contained in:
bendikro 2016-04-13 03:06:25 +02:00 committed by Calum Lind
parent e379e035c7
commit e827420569
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# Increase open file descriptor limit to allow tests to run
# without getting error: what(): epoll: Too many open files
from __future__ import print_function
try:
import resource
except ImportError: # Does not exist on Windows
pass
else:
try:
resource.setrlimit(resource.RLIMIT_NOFILE, (65536, 65536))
except (ValueError, resource.error) as ex:
print("Failed to raise file descriptor limit:", ex)