subprocess not killed when timeout fires
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 32/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- operating-systems, testing-qa
Línea de trabajo
Empieza rastreando la gestión de los timeouts de pytest-timeout y cómo termina pytest en Windows; el issue no indica ningún archivo fuente ni ninguna prueba. Reproduce después el escenario de subprocess.Popen descrito en el issue y verifica que una prueba cuyo tiempo de espera se ha agotado no deje ningún proceso hijo y que el trabajo de GitLab termine.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I've been using pytest-timeout for some time to catch whenever we have bad tests that just hang for a long time.
This doesn't happen very often and most of the time it happens locally and pytest-timeout saves the day.
We've been having an issue for some time when we run our tests in GitLab CI and a test ends up running for too long and then it's killed by pytest-timeout, The GitLab job hangs and eventually the GitLab runner crashes.
I debugged it today both locally and on GitLab and the issue I found is that we have a fixture where we open a server application using subprocess.Popen().
In the case where one of our tests takes too long and pytest is killed by pytest-timeout the subprocess remains open in the background.
Locally this isn't an issue because we cleanup any hanging processes at the start of our tests so they don't affect subsequent tests.
However in GitLab the job doesn't finish until all the processes are closed. Because the parent process is closed the GitLab runner isn't able to find any of the child processes and close those and everything hangs.
I'm running on Windows by the way.
So to get to my question, is there a way I can ensure that when pytest-timeout fires and kills pytest that it also kills any open subprocesses?
Thank you,
Alex
- 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#190 · 9 comentarios ·
-
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 ·
Todos los issues de pytest-dev/pytest-timeout
Issues similares
-
feature:LinkChecker
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
digitalfabrik/integreat-cms#4594 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
EleutherAI/lm-evaluation-harness#4319 ·
Los mantenedores suelen responder en 1 día
-
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