0

I've got an "old" laptop running Lubuntu which i run Robotframework scripts on, connected to a raspberrypi (via ethernet cable).

The laptop has paramiko 2.7.1 and otherwise up to date python packages (let me know if you want versions of specific packages).

These tests include opening, connecting and executing commands via SSH.

There are zero problems with SSH outside robotframework test scripts and never had any instability with ssh.

When i run the robot script, it executes some commands (with Execute Command keywords) and checks if the commands are completed successfully.

More often than not, one or two of the 8 (even sometimes 4) tests fail because of the SSHLibrary exception SSHLibrary Exception: Timeout opening tunnel.

For now I've set up a script that automatically reruns the failed test cases and 99% of the time, the rerun test cases pass. I would however much rather have stable test cases.

5
  • How much is your current SSH timeout and how much increase would be acceptable for you? Commented Aug 27, 2020 at 11:04
  • I've attempted to use Execute Command COMMAND timeout=10s but it seems like this timeout is only for the keyword to complete and not the actual ssh connection timeout. Right now the timeout can be whatever while i test. How would i set the actuall ssh timeout? Commented Aug 27, 2020 at 11:15
  • 1
    When you import the library Library SSHLibrary 10 seconds you can pass it as an argument to the library. Also you can set it when opening a connection Open Connection 192.168.1.1 timeout=5 min. And on the fly with the Set Client Configuration timeout=1 min. Commented Aug 27, 2020 at 11:21
  • Any luck with the timeouts? Commented Aug 28, 2020 at 12:56
  • I don't seem to have the problem currently after inserting timeouts. - I haven't seen a SSH timeout happen yet. I do however get a frequently FAILED test case with SSHException: No existing session but i think that could be caused by the way the test case is setup (It's happening every 2/3 times it is run). I will let the test cases run continuously overnight and return with the findings here. Thank you! Commented Aug 28, 2020 at 15:31

1 Answer 1

2

I would consider a reasonable increase of the SSH timeout to resolve the issue. These are your options:

  1. You can set a timeout at library import.

    Library     SSHLibrary  10 seconds
    
  2. You can set the connection timeout when you open the connection.

    Open Connection     192.168.1.1     timeout=5 min
    
  3. Lastly you can set the timeout on the fly using the Set Client Configuration keyword.

    Set Client Configuration    timeout=1 min
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.