From 3925048bfd467afd527ea15574ab691cb2390e4d Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 26 May 2023 16:15:09 +0200 Subject: [PATCH] [matter_yamltests] Increase the keep alive timeout for websockets (#26870) --- .../py_matter_yamltests/matter_yamltests/websocket_runner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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