# HG changeset patch # User Pierre-Yves David # Date 1712683532 -7200 # Node ID d0e2b0101bfc5a9fbe314969943c94c6ccbc5b3e # Parent 107c5af631a7766695e004cf85f9338d758944bb ci: limit maximum number of open file on python2 On the clever cloud runner, the number of maximum open files is 1 073 741 816. Since python 2 implementation of `subprocess.Popen(…, close_fds=True)` is quite stupid¹, this becomes a significant problem there. Spawning a subprocess with `close_fds=True` take 9 minutes (nine!). Since each test runs in a subprocess, this makes running the test suite with Python 2 on the Clever Cloud runner impossible. To fix this, we simply limit the maximum number of open file descriptors when running with Python2. [1] https://bugs.python.org/issue35757 diff -r 107c5af631a7 -r d0e2b0101bfc .gitlab-ci.yml --- a/.gitlab-ci.yml Fri Mar 29 15:02:02 2024 -0300 +++ b/.gitlab-ci.yml Tue Apr 09 19:25:32 2024 +0200 @@ -27,8 +27,8 @@ - (cd tests; ls -1 test-check-*.t > /tmp/check-tests.txt) script: - *prepare_hg - - ("$PYTHON" --version) - - (cd tests; set -x; HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" /ci/repos/mercurial/tests/run-tests.py --color=always $RUNTEST_ARGS) + - ($PYTHON --version) + - (cd tests; set -x; HGMODULEPOLICY="$TEST_HGMODULEPOLICY" $PYTHON /ci/repos/mercurial/tests/run-tests.py --color=always $RUNTEST_ARGS) checks-py3: <<: *runtests @@ -51,7 +51,7 @@ <<: *runtests variables: PY: py2 - PYTHON: python2 + PYTHON: prlimit --nofile=1024:1024 python2 RUNTEST_ARGS: "--no-rust --blacklist /tmp/check-tests.txt" TEST_HGMODULEPOLICY: "c" HG_BRANCH: 'max(tag("re:^6\.1"))'