mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-13 14:16:54 +00:00
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.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user