1.34.0: test_environment_variables fails on really fast CI runners
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with tests/workspace/test_builder.py and test_environment_variables, especially the pane.capture_pane() assertion at line 410. Run this test under the reported CI conditions and compare the existing timeout behavior. Done means the test reliably passes on fast amd64 and s390x CI runners without intermittent IndexError failures.
Written by the indexing model from the issue text.
Description
Step 1: Provide a summary of your problem
I'm the Debian maintainer for tmuxp, and on fast amd64 and s390x CI hosts, test_environment_variables sometimes fails. This happens in different locations, but always on a line that asserts pane.capture_pane.
This is Debian bug https://bugs.debian.org/1060775
Step 2: Provide tmuxp details
-------------------------
environment:
dist: Linux-6.6.8-amd64-x86_64-with-glibc2.37
arch: x86_64
uname: Linux; hulk; 6.6.8-amd64
version: #1 SMP PREEMPT_DYNAMIC Debian 6.6.8-1 (2023-12-22)
-------------------------
python version: 3.11.7 (main, Dec 8 2023, 14:22:46) [GCC 13.2.0]
system PATH: /usr/local/bin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
tmux version: 3.3
libtmux version: 0.25.0
tmuxp version: 1.34.0
tmux path: /bin/tmux
tmuxp path: /usr/lib/python3/dist-packages/tmuxp
Step 3: Describe the problem:
I've tried raising the timeout in that test from 0.3s to 3s but we still see failures:
https://ci.debian.net/packages/t/tmuxp/testing/s390x/41861855/
Steps to reproduce:
I can't reproduce this on my personal development machine, unfortunately.
Observed Results:
Here's the failure log:
=== python3.11 ===
============================= test session starts ==============================
platform linux -- Python 3.11.7, pytest-7.4.3, pluggy-1.3.0
rootdir: /tmp/autopkgtest-lxc.1o9ufl7q/downtmp/autopkgtest_tmp
plugins: libtmux-0.25.0, rerunfailures-12.0, hypothesis-6.92.2, mock-3.12.0
collected 194 items / 2 deselected / 192 selected
tests/test_plugin.py .......... [ 5%]
tests/test_shell.py .. [ 6%]
tests/test_util.py ....... [ 9%]
tests/cli/test_cli.py ........ [ 14%]
tests/cli/test_convert.py ........ [ 18%]
tests/cli/test_debug_info.py . [ 18%]
tests/cli/test_freeze.py ...... [ 21%]
tests/cli/test_import.py ....... [ 25%]
tests/cli/test_load.py ...............s........ [ 38%]
tests/cli/test_ls.py . [ 38%]
tests/cli/test_shell.py .................... [ 48%]
tests/tests/test_helpers.py .. [ 50%]
tests/workspace/test_builder.py ...s......Fs............................ [ 70%]
.......... [ 76%]
tests/workspace/test_config.py .............. [ 83%]
tests/workspace/test_finder.py .................. [ 92%]
tests/workspace/test_freezer.py ... [ 94%]
tests/workspace/test_import_teamocil.py ........ [ 98%]
tests/workspace/test_import_tmuxinator.py ... [100%]
=================================== FAILURES ===================================
__________________________ test_environment_variables __________________________
session = Session($1 libtmux_m6iuy9kl)
@pytest.mark.skipif(
has_lt_version("3.0"),
reason="needs -e flag for new-window and split-window introduced in tmux 3.0",
)
def test_environment_variables(
session: Session,
) -> None:
"""Test setting of environmental variables in tmux via workspace builder."""
workspace = ConfigReader._from_file(
test_utils.get_workspace_file("workspace/builder/environment_vars.yaml")
)
workspace = loader.expand(workspace)
builder = WorkspaceBuilder(session_config=workspace, server=session.server)
builder.build(session)
# Give slow shells some time to settle as otherwise tests might fail.
# Debian: raise timeout from 0.3s to 3s to workaround flakyness on really
# fast Debian CI workers (see https://bugs.debian.org/1060775)
time.sleep(3.0)
assert session.getenv("FOO") == "SESSION"
assert session.getenv("PATH") == "/tmp"
no_overrides_win = session.windows[0]
pane = no_overrides_win.panes[0]
pane.send_keys("echo $FOO")
> assert pane.capture_pane()[1] == "SESSION"
E IndexError: list index out of range
tests/workspace/test_builder.py:410: IndexError
Here's a couple of other failed runs, prior to changing the timeout (some of them happened with tmuxp 1.31, as the problem has been present for a while):
https://ci.debian.net/packages/t/tmuxp/testing/amd64/40953851/
https://ci.debian.net/packages/t/tmuxp/testing/amd64/40904252/
https://ci.debian.net/packages/t/tmuxp/testing/s390x/41855336/
https://ci.debian.net/packages/t/tmuxp/testing/s390x/41828952/
https://ci.debian.net/packages/t/tmuxp/testing/s390x/41730238/
Expected Results:
test_environment_variables reliably passes.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 248
- 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/tmuxp
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
tmux-python/tmuxp#1026 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tmux-python/tmuxp#939 · 1 comment ·
-
enhancement WorkspaceBuilder
Difficulty 4/5 3-5 days Newbie friendliness 48/100
tmux-python/tmuxp#1062 ·
-
enhancement need-comments WorkspaceBuilder
Difficulty 5/5 Over a week Newbie friendliness 35/100
tmux-python/tmuxp#1058 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
tmux-python/tmuxp#1053 · 10 comments ·
All issues in tmux-python/tmuxp
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