-
Notifications
You must be signed in to change notification settings - Fork 126
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
bug: tmt try multihost plan breaks terminal #3138
Comments
|
I found a workaround - when test plan begins, I type |
I am providing a simpler reproducer, a plan that provisions 3 nodes, and a simple test. It enough to create two files like below and run
I noticed what exactly causes this - using This issue blocks work on multi-node scenarios that use more than 2 nodes. |
@spetrosi can you try with the following patch applied? diff --git a/tmt/log.py b/tmt/log.py
index 66db71c5..18d848b9 100644
--- a/tmt/log.py
+++ b/tmt/log.py
@@ -287,7 +287,7 @@ class LogfileHandler(logging.FileHandler):
# with older Python versions. Since it's not critical to mark the handler as "str only", we can
# ignore the issue for now.
class ConsoleHandler(logging.StreamHandler): # type: ignore[type-arg]
- pass
+ terminator = '\r\n'
class _Formatter(logging.Formatter): |
@happz it definitelly helps, but not everywhere. With the reproducer, it helps in the test phase, but the interactive menu is still broken. And after run finishes, I am not able to type in this terminal.
|
Is there anything special, or uncommon about your terminal settings? Because I'm unable to reproduce the problem, and since it looks like at some point, |
Never mind, I just reproduced the problem. FTR, it works perfectly fine with |
Right, I am using virtual. Recently I tried using different terminals or a terminal in vscodium with same results. I too had a feeling that it may an issue on my side. |
So, running A couple of notes to think about:
I would even guess this might be simply the cause here, 3 SSH processes fighting over 1 terminal. Sooner or later, one of them does A and the other one undoes it, and we end up with an inconsistent setup. We can add With the interactive mode disabled in |
3 trivial Beakerlib tests +
|
Many thanks for finding the cause of this. We are running tests in testing farm via https://github.com/marketplace/actions/schedule-tests-on-testing-farm, e.g. in https://github.com/linux-system-roles/ha_cluster/actions/runs/10450150449/job/28933928537. |
That is expected, because TF does not run them in interactive mode, and they don't share stdout/stderr channels.
Yes, something along those lines. I would dare to suggest disabling interactive mode in multihost scenarios by default - on top of output formatting, how about shared stdin? All three branches of testing share it, if the user wants to interact with the test, which one of them? The one on guest 1, or the one on guest 2? Maybe the one on guest 3 which is still running? This quickly turns into getting ugly output & not being able to use input reliably either. Maybe we need some kind of window, like ncurses windows: split the screen, have a window for the menu and a window for each guest, separate their output, and let users switch between windows when talking to their tests. In any case, shared stdout and/or stdin will cause trouble. |
Is it possible to use
|
After running a plan with multi-host provisioning with 3+ hosts, terminal "breaks", it prints many spaces in the beginning of the lines, and then doesn't work. With two nodes, the output is fine. With >3 nodes, it starts shifting.
Plan from plans/test_plan.fmf:
I am running it with
tmt try -p plans/test_plan centos-stream-9
What my terminal outputs: https://pastebin.com/Ae18humU
Terminal breaks after
Running 'rlImport library'
lineThe text was updated successfully, but these errors were encountered: