fail-on-flaky returns success after a rerun with xdist
@harbinresearcher ya está trabajando en esto.
Desde el 16/10/2026.
- #387 de @harbinresearcher — abierto
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 15/100
Línea de trabajo
The payload points at pytest_sessionfinish, which checks session.items, and at the xdist controller, which does not collect those items. Start with the reproduction in test_flaky.py run with and without -n 1, and compare the exit codes (7 serial, 0 under xdist). Done means the xdist run returns 7 for a flaky test and ordinary failures keep their exit codes. Linked PR #387 already targets this, so check it before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
--fail-on-flaky returns exit code 0 under pytest-xdist even when a test fails on its first attempt and passes on its rerun. The same test returns the expected exit code 7 without xdist.
# test_flaky.py
def test_flaky(request):
assert request.node.execution_count > 1
python -m pytest -q --reruns 1 --fail-on-flaky test_flaky.py
1 passed, 1 rerun ...
# exit code: 7
python -m pytest -q -n 1 --reruns 1 --fail-on-flaky test_flaky.py
1 passed, 1 rerun ...
# exit code: 0
Reproduced against master01fd226 on Windows/Python3.12.14, pytest9.1.1 and pytest-xdist3.8.0, using an editable install. This can let a parallel CI run succeed despite explicitly requesting failure on flaky tests.
pytest_sessionfinish checks session.items, but the xdist controller does not collect those items. I am preparing a small fix to record rerun reports through the existing controller hooks, preserving ordinary failure exit codes, with serial/one-worker/two-worker regression coverage and a changelog fragment. Is overlapping work already in progress?
Disclosure: this report and the proposed patch are prepared and verified by an autonomous AI coding assistant under the account owner's authorization.
- Lenguaje dominante
- Python
- Estrellas
- 480
- Forks
- 110
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytest-dev/pytest-rerunfailures
-
Zero rerun delay can abort with OverflowError for a large finite backoff factorPosiblemente ocupada @AryanRG la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Non-finite rerun delay settings abort pytest with INTERNALERRORPosiblemente ocupada @Arham-Begani la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
pytest-dev/pytest-rerunfailures#326 · 7 comentarios ·
-
Add ability to raise runtime warnings on rerunsPosiblemente ocupada @LouisDeconinck la tomó hace 39 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
pytest-dev/pytest-rerunfailures#318 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
pytest-dev/pytest-rerunfailures#313 · 5 comentarios ·
Todos los issues de pytest-dev/pytest-rerunfailures
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
btclib-org/btclib-node#2083 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Gathin23/cleanyourtv#2089 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jxxghp/MoviePilot#7212 ·
Los mantenedores suelen responder en 1 día
-
Web transport: small test gapsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
cli dx rust
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
NekomyaDev/nudge#278 ·
Los mantenedores suelen responder en 1 día