From 9be996ba0ea9d01ffd7fb003428cd2a3ece3a22f Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sun, 10 Nov 2024 01:23:29 +0100 Subject: [PATCH] Core: downgrade websockets and minor fixes (#4166) * Core: downgrade websockets to 13.x 14.x currently doesn't work for MultiServer. 14.x is not supported with py3.8, so updating to 14.x should be scheduled for AP 0.6.0. * CI: 5min timeout for hosting test * MultiServer: properly shutdown even if ctx is invalid * CI: increase hosting test timeout to 10min this is 4x expected time, just to be safe. --- .github/workflows/unittests.yml | 2 +- MultiServer.py | 6 ++++-- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 9a3a6d11217f..a38fef8fda08 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -89,4 +89,4 @@ jobs: run: | source venv/bin/activate export PYTHONPATH=$(pwd) - python test/hosting/__main__.py + timeout 600 python test/hosting/__main__.py diff --git a/MultiServer.py b/MultiServer.py index bac35648cf5a..764b56362ecc 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1960,8 +1960,10 @@ def _cmd_status(self, tag: str = "") -> bool: def _cmd_exit(self) -> bool: """Shutdown the server""" - self.ctx.server.ws_server.close() - self.ctx.exit_event.set() + try: + self.ctx.server.ws_server.close() + finally: + self.ctx.exit_event.set() return True @mark_raw diff --git a/requirements.txt b/requirements.txt index 6fe14c9f32ce..946546cb6961 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ colorama>=0.4.6 -websockets>=13.0.1 +websockets>=13.0.1,<14 PyYAML>=6.0.2 jellyfish>=1.1.0 jinja2>=3.1.4