aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-02-13 19:37:08 -0800
committerZac Medico <zmedico@gentoo.org>2024-02-14 11:07:57 -0800
commitffcb1eb3ded0dbd244836ab3020fdc5244407298 (patch)
tree84c456684f7c7480a102be77eaa55367abeffbab /.github
parentBuildLogger: Fix portage.locks._open_fds memory leak (diff)
downloadportage-ffcb1eb3ded0dbd244836ab3020fdc5244407298.tar.gz
portage-ffcb1eb3ded0dbd244836ab3020fdc5244407298.tar.bz2
portage-ffcb1eb3ded0dbd244836ab3020fdc5244407298.zip
actions: Use pytest-rerunfailures for pytest-xdist worker crash
Since pytest-xdist workers crash intermittently for the multiprocessing spawn start method, use pytest-rerunfailures to detect and handle this case. Only use pytest-rerunfailures for the spawn start-method since that is the only case where we've observed intermittent pytest-xdist worker crashes, and use --only-rerun 'worker .* crashed while running' to ensure that rerun only triggers for worker crashes. Bug: https://bugs.gentoo.org/924416 See: https://github.com/pytest-dev/execnet/issues/96 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml9
1 files changed, 4 insertions, 5 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 762999b7c..e4168203d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -53,7 +53,7 @@ jobs:
python -m site
python -m pip install --upgrade pip
# setuptools needed for 3.12+ because of https://github.com/mesonbuild/meson/issues/7702.
- python -m pip install pytest pytest-xdist setuptools
+ python -m pip install pytest pytest-rerunfailures pytest-xdist setuptools
# symlink /bin/true to /usr/bin/getuto (or do we want to grab the script from github?)
sudo ln -s /bin/true /usr/bin/getuto
@@ -90,8 +90,7 @@ jobs:
- name: Run tests for ${{ matrix.python-version }}
run: |
[[ "${{ matrix.start-method }}" == "spawn" ]] && export PORTAGE_MULTIPROCESSING_START_METHOD=spawn
- # spawn start-method crashes pytest-xdist workers (bug 924416)
- [[ "${{ matrix.start-method }}" == "spawn" ]] && \
- export PYTEST_ADDOPTS="-vv -ra -l -o console_output_style=count" || \
- export PYTEST_ADDOPTS="-vv -ra -l -o console_output_style=count -n $(nproc) --dist=worksteal"
+ export PYTEST_ADDOPTS="-vv -ra -l -o console_output_style=count -n $(nproc) --dist=worksteal"
+ # Use pytest-rerunfailures to workaround pytest-xdist worker crashes with spawn start-method (bug 924416).
+ [[ "${{ matrix.start-method }}" == "spawn" ]] && PYTEST_ADDOPTS+=" --reruns 5 --only-rerun 'worker .* crashed while running'"
meson test -C /tmp/build --verbose