diff options
author | Andrew Klychkov <aklychko@redhat.com> | 2021-10-28 00:00:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 14:00:14 -0700 |
commit | e50ad6f118125dc2a8cc51aac6048763e2fe701b (patch) | |
tree | 5aee04c466fc6b7ca10788cfd7c9290fdb803611 /test | |
parent | 1ab2443e2d31aaad0e9d78d6f86fdbf28a145991 (diff) | |
download | ansible-e50ad6f118125dc2a8cc51aac6048763e2fe701b.tar.gz |
ansible-test: Set max number of open files in containers to 10240 (#75498)
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/ansible_test/_internal/docker_util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lib/ansible_test/_internal/docker_util.py b/test/lib/ansible_test/_internal/docker_util.py index da113f02a1..cab2451f86 100644 --- a/test/lib/ansible_test/_internal/docker_util.py +++ b/test/lib/ansible_test/_internal/docker_util.py @@ -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] |