Flaky test: test_capture_pane_flags[join_wrapped_numbers] matches marker in command echo
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- python
- Área
- testing-qa
Línea de trabajo
Comienza con test_capture_pane_flags[join_wrapped_numbers] y la comprobación de command_complete() mostrada en el issue. Reproduce el fallo intermitente, asegúrate de que el marcador se detecte únicamente a partir de la salida del comando y no del eco del comando de shell, y ejecuta el test indicado para confirmar que pasa de forma fiable.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug
test_capture_pane_flags[join_wrapped_numbers] fails intermittently because the completion marker is detected in the shell command echo line before the command actually executes.
Root cause
The command_complete() check uses:
def command_complete() -> bool:
output = "\n".join(pane.capture_pane())
return marker in output
This matches the marker string inside the prompt echo ($ printf ... echo "__DONE_join_wrapped_numbers__") — a false positive. The shell echoes the full command before executing it, so the marker appears in the pane buffer before seq produces any output.
Expected behavior
The marker should only be detected when it appears as command output (its own line), not as part of the typed command echo.
Fix
Change the check to skip lines that start with the shell prompt ($):
def command_complete() -> bool:
lines = pane.capture_pane()
return any(marker in line and not line.lstrip().startswith("$") for line in lines)
Reproduction
The failure is timing-dependent. On fast systems seq completes before the next capture, masking the bug. On slower systems or CI, the race is more visible.
- Lenguaje dominante
- Python
- Estrellas
- 1.2k
- Forks
- 127
- Merge medio
- 2 h 13 min
- PR fusionados (30 d)
- 1
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 tmux-python/libtmux
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
tmux-python/libtmux#759 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
tmux-python/libtmux#745 · 2 comentarios ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tmux-python/libtmux#744 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tmux-python/libtmux#731 ·
-
feature: upstream capture_since Abiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
tmux-python/libtmux#740 · 1 comentario ·
Todos los issues de tmux-python/libtmux
Issues similares
-
documentation help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
simonw/sqlite-utils#872 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100