tmux-python / tmux-python/libtmux
Intermittent / flaky test test_capture_pane
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 127
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 1
Description
There is another test that sometimes / intermittently / not reproducibly fails: test_capture_pane
This is for x86_64, i586, armv7l and ppc64.
I know the exact error message would be helpful, but I was too quick in fixing and now I cannot reproduce. I'll supply the error message as soon as the package fails again.
[ 64s] =================================== FAILURES ===================================
[ 64s] ______________________________ test_capture_pane _______________________________
[ 64s]
[ 64s] session = Session($1 libtmux_zv_reb2k)
[ 64s]
[ 64s] def test_capture_pane(session: Session) -> None:
[ 64s] env = shutil.which("env")
[ 64s] assert env is not None, "Cannot find usable `env` in PATH."
[ 64s]
[ 64s] session.new_window(
[ 64s] attach=True,
[ 64s] window_name="capture_pane",
[ 64s] window_shell=f"{env} PS1='$ ' sh",
[ 64s] )
[ 64s] pane = session.attached_window.attached_pane
[ 64s] assert pane is not None
[ 64s] pane_contents = "\n".join(pane.capture_pane())
[ 64s] assert pane_contents == "$"
[ 64s] pane.send_keys(
[ 64s] r'printf "\n%s\n" "Hello World !"', literal=True, suppress_history=False
[ 64s] )
[ 64s] pane_contents = "\n".join(pane.capture_pane())
[ 64s] > assert pane_contents == r'$ printf "\n%s\n" "Hello World !"{}'.format(
[ 64s] "\n\nHello World !\n$"
[ 64s] )
[ 64s] E assert '$ printf "\\...ello World !"' == '$ printf "\\...lo World !\n$'
[ 64s] E - $ printf "\n%s\n" "Hello World !"
[ 64s] E ? -
[ 64s] E + $ printf "\n%s\n" "Hello World !"
[ 64s] E -
[ 64s] E - Hello World !
[ 64s] E - $
[ 64s]
[ 64s] tests/test_pane.py:90: AssertionError
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.
Research direction
Start with tests/test_pane.py and run test_capture_pane on the affected architectures if available. Investigate why the captured pane contents sometimes omit the command output or prompt, and use the failure details to define a reliable test result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100