[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:
parent
e379e035c7
commit
e827420569
|
@ -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)
|
Loading…
Reference in New Issue