ansible-test: Set max number of open files in containers to 10240 (#75498)

This commit is contained in:
Andrew Klychkov
2021-10-27 14:00:14 -07:00
committed by GitHub
parent 1ab2443e2d
commit e50ad6f118
2 changed files with 8 additions and 0 deletions
@@ -0,0 +1,2 @@
minor_changes:
- ansible-test - Change the maximum number of open files in a test container from the default to ``10240``.
@@ -37,6 +37,10 @@ DOCKER_COMMANDS = [
'podman',
]
# Max number of open files in a docker container.
# Passed with --ulimit option to the docker run command.
MAX_NUM_OPEN_FILES = 10240
class DockerCommand:
"""Details about the available docker command."""
@@ -232,6 +236,8 @@ def docker_run(
# Only when the network is not the default bridge network.
options.extend(['--network', network])
options.extend(['--ulimit', 'nofile=%s' % MAX_NUM_OPEN_FILES])
for _iteration in range(1, 3):
try:
stdout = docker_command(args, [command] + options + [image] + cmd, capture=True)[0]