Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test_timeout: Skip test_timeout_warn on Python 3.11 for coverage issue.
Anders Kaseorg4b198630659b
diff --git a/zerver/lib/timeout.py b/zerver/lib/timeout.pyindex 591e07c52af..6495719ab4d 100644--- a/zerver/lib/timeout.py+++ b/zerver/lib/timeout.py@@ -84,9 +84,9 @@ def timeout(timeout: float, func: Callable[[], ResultT]) -> ResultT:# kill it), just raise from here; the thread _may still be# running_ because it failed to see any of our exceptions, and# we just ignore it.- if thread.is_alive():+ if thread.is_alive(): # nocoveragelogging.warning("Failed to time out backend thread")- raise TimeoutExpiredError+ raise TimeoutExpiredError # nocoverageif thread.exc_info[1] is not None:# Died with some other exception; re-raise itdiff --git a/zerver/tests/test_timeout.py b/zerver/tests/test_timeout.pyindex fe2eac8f1d7..945aa37a98b 100644--- a/zerver/tests/test_timeout.py+++ b/zerver/tests/test_timeout.py@@ -1,5 +1,7 @@+import sysimport timeimport traceback+from unittest import skipIffrom zerver.lib.test_classes import ZulipTestCasefrom zerver.lib.timeout import TimeoutExpiredError, timeout@@ -39,6 +41,7 @@ class TimeoutTestCase(ZulipTestCase):self.assertIn("in something_exceptional", tb[-1])self.assertIn("raise ValueError", tb[-1])+ @skipIf(sys.version_info >= (3, 11), "https://github.com/nedbat/coveragepy/issues/1626")def test_timeout_warn(self) -> None:# If the sleep is long enough, it will outlast the attempts to# kill it