[matter_yamltests] Increase the keep alive timeout for websockets (#26870)

diff --git a/scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py b/scripts/py_matter_yamltests/matter_yamltests/websocket_runner.py
index 2045bba..9a40ec5 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 @@
             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