From 33691f975e3d0114ab802ffd0f0b872c1fbd26ae Mon Sep 17 00:00:00 2001 From: CMGS Date: Mon, 9 Nov 2026 21:04:41 +0800 Subject: [PATCH] sdk/python: the upgrade fake stops listening once it accepts A refused upgrade rebinds the handle, and its peers lookup queued on the fake's still-open listener until two 5 s timeouts ran out. Closing the listener makes the lookup fail at once: test_upgrade.py drops from 20.3 s to 0.22 s and the SDK suite from ~87 s to ~65 s on python:3.10. --- sdk/python/tests/test_upgrade.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/python/tests/test_upgrade.py b/sdk/python/tests/test_upgrade.py index 6f0b11920..f87f730ca 100644 --- a/sdk/python/tests/test_upgrade.py +++ b/sdk/python/tests/test_upgrade.py @@ -36,6 +36,7 @@ def stop(self) -> None: def _serve(self) -> None: conn, _ = self._server.accept() + self._server.close() with conn, contextlib.suppress(OSError): reader = conn.makefile("rb") while reader.readline() not in (b"\r\n", b""):