diff --git a/scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py b/scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py index 2045bba732be13..9a40ec5977e5a4 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py +++ b/scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py @@ -22,6 +22,8 @@ from .hooks import WebSocketRunnerHooks from .runner import TestRunner +_KEEP_ALIVE_TIMEOUT_IN_SECONDS = 40 + @dataclass class WebSocketRunnerConfig: @@ -65,7 +67,7 @@ async def _start_client(self, url, max_retries=4, interval_between_retries=1): start = time.time() try: self._hooks.connecting(url) - connection = await websockets.connect(url) + connection = await websockets.connect(url, ping_timeout=_KEEP_ALIVE_TIMEOUT_IN_SECONDS) duration = round((time.time() - start) * 1000, 0) self._hooks.success(duration) return connection