Flaky test: test_capture_pane_flags[join_wrapped_numbers] matches marker in command echo
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start with test_capture_pane_flags[join_wrapped_numbers] and the command_complete() check shown in the issue. Reproduce the intermittent failure, ensure the marker is detected only from command output rather than the shell command echo, and run the named test to confirm it passes reliably.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 127
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tmux-python/libtmux
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
tmux-python/libtmux#759 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tmux-python/libtmux#745 · 2 comments ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tmux-python/libtmux#744 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tmux-python/libtmux#731 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 65/100
tmux-python/libtmux#740 · 1 comment ·
All issues in tmux-python/libtmux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100