From 033d6ade6cd1ff220f9d055cd8f8ced773c9d16f Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Tue, 27 Aug 2024 16:00:01 +0200 Subject: [PATCH] set keepalive on ssh to prevent silent connection failures --- tests/integration/tools/ssh.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration/tools/ssh.py b/tests/integration/tools/ssh.py index 64b67b6..9f1dc9b 100644 --- a/tests/integration/tools/ssh.py +++ b/tests/integration/tools/ssh.py @@ -69,6 +69,9 @@ def ssh_connect(hostname: str, port: int = 22, username: str | None = None) -> p look_for_keys=True, allow_agent=True, ) + transport = client.get_transport() + assert transport is not None # for mypy; after connect, transport is set + transport.set_keepalive(5) return client