Flaky test: test_capture_pane_flags[join_wrapped_numbers] matches marker in command echo
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với test_capture_pane_flags[join_wrapped_numbers] và kiểm tra command_complete() được nêu trong issue. Tái hiện lỗi xảy ra không liên tục, đảm bảo marker chỉ được phát hiện từ đầu ra của lệnh chứ không phải từ phần echo của lệnh shell, rồi chạy test được nêu tên để xác nhận rằng test luôn pass ổn định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1.2k
- Fork
- 127
- Merge trung bình
- 2 giờ 13 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tmux-python/libtmux
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
tmux-python/libtmux#759 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tmux-python/libtmux#745 · 2 bình luận ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
tmux-python/libtmux#744 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tmux-python/libtmux#731 ·
-
feature: upstream capture_since Đang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
tmux-python/libtmux#740 · 1 bình luận ·
Tất cả issue của tmux-python/libtmux
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100