From ca5281a2d367716af0b688d75caf2d17d1d89621 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 30 Oct 2026 20:11:44 +0800 Subject: [PATCH] test(python): use a threaded mock server for remote tests Use `ThreadingHTTPServer` for the shared remote-test mock so concurrent `table.add` requests are not handled serially by the test server. Validation: - Reproduced the connection-reset/response-decoding failure against base `13749a3f138fde2647c8bdb8a1c05545026aee57`: 27 targeted runs passed, then the 28th matched the original CI failure. - The patched target passed 100/100 runs; `test_remote_db.py` passed 261 tests with 2 skipped. - Ruff 0.9.9 format and lint checks passed. - Current-head GitHub CI: 19/19 check runs and 5/5 workflow runs succeeded. --- python/python/tests/test_remote_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/python/tests/test_remote_db.py b/python/python/tests/test_remote_db.py index 415f8be3c..b59975571 100644 --- a/python/python/tests/test_remote_db.py +++ b/python/python/tests/test_remote_db.py @@ -56,7 +56,7 @@ def test_connect_rejects_invalid_cloud_dns_hostname(db_name): @contextlib.contextmanager def mock_lancedb_connection(handler, **client_config): - with http.server.HTTPServer( + with http.server.ThreadingHTTPServer( ("127.0.0.1", 0), make_mock_http_handler(handler) ) as server: port = server.server_address[1]