`test_profiling` sometimes times out under TSan
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
We don't currently run test_profiling in the TSan CI, but the context is that I'm trying to get the entire test suite running under thread sanitizer (TSan).
Some of the tests in test_profiling fail to attach in time when run with thread sanitizer, because the sanitizer makes everything slower. This is especially the case when running tests in parallel with -j.
Here's a example:
ERROR: test_run_failed_script_live (test.test_profiling.test_sampling_profiler.test_live_collector_ui.TestLiveModeErrors.test_run_failed_script_live)
Test that running a failing script exits with clean error.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/sgross/tsan-cpython/Lib/profiling/sampling/cli.py", line 279, in _run_with_sync
_wait_for_ready_signal(sync_sock, process, _SYNC_TIMEOUT_SEC)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sgross/tsan-cpython/Lib/profiling/sampling/cli.py", line 223, in _wait_for_ready_signal
raise socket.timeout("timed out")
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sgross/tsan-cpython/Lib/profiling/sampling/cli.py", line 1110, in _handle_live_run
process = _run_with_sync(cmd, suppress_output=True)
File "/home/sgross/tsan-cpython/Lib/profiling/sampling/cli.py", line 289, in _run_with_sync
raise RuntimeError(
"Process failed to signal readiness within timeout"
)
RuntimeError: Process failed to signal readiness within timeout
I think the problem is that the the _SYNC_TIMEOUT_SEC of 5 seconds isn't enough in this case:
Here are some options to consider:
- Make
_SYNC_TIMEOUT_SECconfigurable via a command line option and specify a larger value for the tests (i.e., SHORT_TIMEOUT) - Make
_SYNC_TIMEOUT_SECconfigurable via environment variable - Skip these tests under TSan
- ???
cc @pablogsal
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.
Línea de trabajo
Empieza en Lib/profiling/sampling/cli.py, en _SYNC_TIMEOUT_SEC y _wait_for_ready_signal, y después inspecciona el caso fallido de test_profiling, test_run_failed_script_live. Ejecuta las pruebas de profiling bajo TSan, incluida la ejecución en paralelo con -j, y compara las convenciones existentes de las pruebas para el comportamiento específico de los sanitizers. Se considera terminado cuando las pruebas afectadas se completen de forma fiable bajo TSan sin reducir la cobertura normal de las pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- performance, testing
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100