mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
ansible-test: Set max number of open files in containers to 10240 (#75498)
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user