diff --git a/sanic/websocket.py b/sanic/websocket.py index a2c7b81d4c..4ae83c853e 100644 --- a/sanic/websocket.py +++ b/sanic/websocket.py @@ -113,7 +113,7 @@ async def websocket_handshake(self, request, subprotocols=None): # hook up the websocket protocol self.websocket = WebSocketCommonProtocol( - timeout=self.websocket_timeout, + close_timeout=self.websocket_timeout, max_size=self.websocket_max_size, max_queue=self.websocket_max_queue, read_limit=self.websocket_read_limit, diff --git a/setup.py b/setup.py index 35d1228e58..db788803ca 100644 --- a/setup.py +++ b/setup.py @@ -79,7 +79,7 @@ def open_local(paths, mode="r", encoding="utf8"): uvloop, ujson, "aiofiles>=0.3.0", - "websockets>=7.0,<9.0", + "websockets>=8.1,<9.0", "multidict>=4.0,<5.0", "httpx==0.11.1", ] diff --git a/tests/test_reloader.py b/tests/test_reloader.py index 5c6415b875..5eccb8011b 100644 --- a/tests/test_reloader.py +++ b/tests/test_reloader.py @@ -1,8 +1,9 @@ import os import secrets import sys +from contextlib import suppress -from subprocess import PIPE, Popen +from subprocess import PIPE, Popen, TimeoutExpired from tempfile import TemporaryDirectory from textwrap import dedent from threading import Timer @@ -85,4 +86,5 @@ async def test_reloader_live(runargs, mode): finally: timeout.cancel() terminate(proc) - proc.wait(timeout=3) + with suppress(TimeoutExpired): + proc.wait(timeout=3) diff --git a/tox.ini b/tox.ini index 321e3a5566..dc272c6d57 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ deps = gunicorn pytest-benchmark uvicorn - websockets>=7.0,<8.0 + websockets>=8.1,<9.0 commands = pytest {posargs:tests --cov sanic} - coverage combine --append