Closed yanivy-nr closed 2 years ago
Hm, when ssh
terminates due to the connection timing out, I would expect the entire channel over which the session ran to terminate as well. Evidently, this is not working here. I will have to investigate.
In the meantime, can you run the same command but with one more -v
flag to show all channel communication? Please post the log here, maybe there is something more in there which could help...
I pushed PR #74 which should be a fix for this. Please give it a try and tell me whether it actually helps...
Hi,
Thank you for the prompt response and for the fix, I can confirm it works now.
I am getting a ChannelClosedException when the SSH connection breaks and the tests fail.
Kind regards, Yaniv
venv/lib/python3.8/site-packages/tbot/machine/channel/subprocess.py:97: ChannelClosedException
============================================================ short test summary info ============================================================
FAILED devel/ssh_test.py::test_ssh_break - tbot.machine.channel.channel.ChannelClosedException
======================================================= 1 failed, 4 deselected in 31.93s ========================================================
Hello,
Sometimes, when running tests on our device the device crashes and the SSH connection breaks. When this happens TBot waits Indefinitely. We are using the
connector.SSHConnector
connector, and have added the following options to ssh via ssh_config property:['ConnectTimeout=5', 'ServerAliveInterval=1', 'ServerAliveCountMax=5']
. With these options, SSH detects that the device has failed, but TBot does not detect it and continues to wait for an input from SSH.Please see below an example of output. After "exit" is printed, TBot is waiting indefinitely:
Is there a way to detect that the SSH connection lost and fail the test in such case?
thanks, Yaniv