Set timeout for both test function only and test function + all fixture setup and teardown
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza revisando la configuración existente timeout_func_only y la gestión de los tiempos de espera para las funciones de prueba, los fixtures, el setup y el teardown. Define cómo deben configurarse y verificarse los tiempos de espera independientes, solo para funciones y para pruebas completas, tanto para la ejecución rápida de pruebas como para el caso de uso de CI.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
It would be nice if it was possible to set a separate timeout for calling the function instead of just setting that the timeout applies only to the function. Currently I can set timeout_func_only = true in pyproject.toml, but that means that all timeouts apply only to the test function.
Concretely, The problem is that I have two kind of timeouts.
I would like to enforce that a selection of tests are fast when fixtures that can be cached are ignored. I currently run those like this:
pytest -m "not slow" tests/ --timeout=10
with timeout_func_only = true in pyproject.toml.
This is to maintain a set (the majority in our case, more than 2k), can be ran quickly (takes less than 40s with caching and pytest-xdist). Each of those tests should take less than 0.1s so a generous timeout of 10s seems appropriate. Only setting a session timeout for this run is not as reliable as it can vary widely because of pytest-xdist.
However, when running all tests in a CI runner, I need to set an appropriate large timeout (roughly 300s) for each test in order to avoid that a hanging test racks up billable minutes. A session timeout works, but needs to be set to an even larger timeout in order to avoid spurious fails due to variation. For this use case I would like to have timeout_func_only = false as slow fixtures matters for billable minutes.
- Lenguaje dominante
- Python
- Estrellas
- 260
- Forks
- 69
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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-timeout
-
PR #200 introduced breaking change - `timeout` value in config is incompatible with older versionsPosiblemente ocupada @Sanjays2402 la tomó hace 40 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
pytest-dev/pytest-timeout#203 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
pytest-dev/pytest-timeout#189 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
pytest-dev/pytest-timeout#181 · 4 reacciones ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
pytest-dev/pytest-timeout#178 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
pytest-dev/pytest-timeout#173 ·
Todos los issues de pytest-dev/pytest-timeout
Issues similares
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")Posiblemente ocupada @mayureshsonawane17 la tomó hoy. AbiertoWaiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Add .devin pluginAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
ayghri/i-have-adhd#249 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
modelscope/FunASR#3762 ·
Los mantenedores suelen responder en 1 día