Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_workspacebuilder.py won't finish - no error message #620

Closed
aRkedos opened this issue Aug 2, 2020 · 12 comments · Fixed by #774 or #783
Closed

test_workspacebuilder.py won't finish - no error message #620

aRkedos opened this issue Aug 2, 2020 · 12 comments · Fixed by #774 or #783
Assignees
Labels
bug Something isn't working

Comments

@aRkedos
Copy link
Contributor

aRkedos commented Aug 2, 2020

Step 1: Provide a summary of your problem

I was trying to run the tests with make test and the workspacebuilder_test seems to run endlessly (did have it running for more than 10 minutes, 2 times) before exiting with C-c.

Sorry if that is a bit too unspecific but I am not that expierienced with tests. So I'll gladly take advice. The reason for running the tests is that I am working on an issue / feature request.

Edit: okay I narrowed it down to the def pane_order_test(). I marked it to be skipped. All other tests pass.
Edit2: I narrowed it down further: the while loop in the test, at least for me, leads to an infinite loop because the breaking condition of if p.current_path == pane_path is never met, it always compares /usr/bin vs. /usr/sbin.

Step 2: Provide tmuxp details

  • Python version 3.8.3
  • system PATH
  • tmux version 3.1b
  • tmuxp version 1.5.5
  • tmux path
  • tmuxp path home/arkedos/Documents/git/tmuxp-dev/bin/tmuxp (virtualenv)
  • libtmux version 0.8.2
  • shell - zsh

Step 3: Describe your environment

  • Architecture: x86_64
  • OS version: Manjaro Linux 20.2 Kernel 5.8 RC

Step 4: Describe the problem:

Steps to reproduce:

  1. run make test
  2. wait...
  3. hit C-c to exit after 10+ Minutes

Observed Results:

  • What happened? This could be a description, log output, etc.
    Not sure what to provide here since I am not that expierenced with tests. So advice is needed.

Expected Results:

  • What did you expect to happen?
    To finish all tests.

Relevant Code:

Did not make changes to testing code.

@aRkedos aRkedos changed the title workspace_builder test workspacebuilder_test won't finish - no error message Aug 2, 2020
@aRkedos aRkedos changed the title workspacebuilder_test won't finish - no error message test_workspacebuilder.py won't finish - no error message Aug 2, 2020
@tony tony self-assigned this Aug 22, 2020
@joseph-flinn joseph-flinn added the bug Something isn't working label Jan 18, 2021
@jerri
Copy link
Contributor

jerri commented Apr 29, 2021

I am not sure if I have the same problem, but I could reproduce and analyse the problem to be connected to the test test_automatic_rename_option. I am executing the tests on my mac. The test checks for the name sh for the window. But for some reasons executing sh leads to a window name of bash. At least in my case. This leads to the check to run forever(?), although the retry()-check should, as far as I understood, prevent the test to stay in an endless loop. But there we are.

Unfortunately I am not quite sure why it is happening and therefore don't have a good idea how to fix it. One probably would have to change the test to instead of using sh, maybe should use a different shell-command (e.g. top which is also used in other tests, I saw). Maybe this would correct the problem. But I have to admit, I don't fully understand the test, as I don't fully understand what feature the rename-option actually provides.

I still hope this little analysis helps to fix the test.

@Avimitin
Copy link

Avimitin commented Apr 19, 2022

This bug still exist. I am running the test in QEMU environment with 1.10.1 version, and it still running in infinite loop. This is because the tmux windows in QEMU output the qemu executable name.

I write some print statement in the test, this is the variable w.name output.

image

And it cause the infinite loop.

image

Avimitin added a commit to Avimitin/archriscv-packages that referenced this issue Apr 19, 2022
A test in package tmuxp will run into infinite loop. The test,
"test_automatic_rename_option", use the pane name as loop break
condition. However in the QEMU environment, the name of the pane will
always be "qemu-riscv64-static", no matter what program user is using.

Upstream report:
tmux-python/tmuxp#620 (comment)

Signed-off-by: Avimitin <avimitin@gmail.com>
@tony
Copy link
Member

tony commented Apr 19, 2022

Perhaps if test_automatic_rename_option were skipped or we added a max retry to it.

@tony
Copy link
Member

tony commented Apr 19, 2022

@avimtin @jerri @aRkedos

Is there a common denominator between your 3 cases, maybe?

  • Your platform (if not otherwise stated)
  • which sh
  • man sh
  • sh -h
  • sh --help

It is looking like the sh command may not be reliable for window naming.

tony added a commit that referenced this issue Apr 19, 2022
#620 users are reporting that
"sh" has a different name used in tmux windows across platforms.
@tony tony added this to tmuxp Apr 19, 2022
@tony tony moved this to In Progress in tmuxp Apr 19, 2022
@tony tony linked a pull request Apr 19, 2022 that will close this issue
tony added a commit that referenced this issue Apr 19, 2022
#620 users are reporting that
"sh" has a different name used in tmux windows across platforms.
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this issue Apr 19, 2022
A test in package tmuxp will run into infinite loop. The test,
"test_automatic_rename_option", use the pane name as loop break
condition. However in the QEMU environment, the name of the pane will
always be "qemu-riscv64-static", no matter what program user is using.

Upstream report:
tmux-python/tmuxp#620 (comment)

Signed-off-by: Avimitin <avimitin@gmail.com>
@categulario
Copy link
Contributor

This is actually exactly what I reported in #704 (comment) . The test hangs and the comparison that never succeeds is /usr/bin != /usr/sbin

Does any of ye @aRkedos @jerri @Avimitin have the problem described in #704 ? it is basically the combo:

layout: main-vertical
options:
  main-pane-width: 30

and then seeing a window with a very thin pane on top.

tony added a commit to tmux-python/libtmux that referenced this issue May 20, 2022
Fixes #368, as retry() in its current form is broke and won't work within a
`with` block. The function is deprecated and will be removed in 0.13.x. 0.12.x
will warn when using it.

retry_until() is now available and will either raise or return False if raise=False
is passed.

See also:
- tmux-python/tmuxp#620
- tmux-python/tmuxp#704 (comment)
tony added a commit that referenced this issue May 21, 2022
#620 users are reporting that
"sh" has a different name used in tmux windows across platforms.
@tony tony closed this as completed in #774 May 21, 2022
tony added a commit that referenced this issue May 21, 2022
Repository owner moved this from In Progress to Done in tmuxp May 21, 2022
@tony
Copy link
Member

tony commented May 21, 2022

@tony tony added this to the Milestone 1.12 milestone May 21, 2022
@Avimitin
Copy link

It seems like the libtmux module doesn't have return_until yet:

E   ImportError: cannot import name 'retry_until' from 'libtmux.test' (/usr/lib/python3.10/site-packages/libtmux/test.py)

I am using python-libtmux 0.11.0.

@tony
Copy link
Member

tony commented May 26, 2022

@Avimitin What version of tmuxp do you have? pip show tmuxp

What command are you running?

@Avimitin
Copy link

I am using the pre-release 1.12.0a5 version. And this error was prompt up when I was running pytest -vv -k "not test_pane_order" command.

@categulario
Copy link
Contributor

@tony just for the record. I am still experiencing this. The issue should not be closed. The symptoms are the same, the comparison /usr/bin == /usr/sbin never becomes true and it times out.

Of course the difference now is that a proper WaitTimeout error raised.

@categulario
Copy link
Contributor

Ok, I just debugged the problem with this test. Maybe @Avimitin can confirm. In my computer /usr/sbin is just an alias for /usr/bin. I guess the way pane.current_path is calculated resolves the real path in the filesystem, thus causing the error. Since the test is only testing for the names of the paths (the rest of them being correctly set) I propose to just use a path that is less likely to be an alias. Sending PR now

@tony
Copy link
Member

tony commented May 27, 2022

@Avimitin @categulario

Released in v1.12.0a6 (github, pypi)

Better now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
6 participants