9 Commits

Author SHA1 Message Date
Jussi Saurio
b46ded716e bindings/python: connect sync tests to the local server over 127.0.0.1
On Windows the Python sync tests took ~5 min per test file, against
~42 s on macOS. The time goes into connections, not work: e.g.
test_bootstrap 10.16 s on Windows vs 0.23 s on macOS, and
test_partial_sync_segment_size (many requests) 122.9 s vs 1.05 s, while
the data-heavy test_pull_bytes_threshold took about the same on both.

The local sync server listens on 0.0.0.0 (IPv4 only), but the tests
connected to "localhost". Windows resolves localhost to ::1 first, and a
refused connection there takes about 2 s before the client falls back to
127.0.0.1, on every new connection. That fits the numbers above; the
Windows CI timings of this change will confirm it.

Connect to 127.0.0.1 directly. The persisted-URL assertion now checks for
the server URL itself instead of the "http://localhost" prefix.
2026-10-14 09:36:51 +03:00
Nikita Sivukhin
8d09e9d03d propagate push/pull thresholds to the python and golang SDK 2026-06-30 13:20:45 +02:00
Orthel Toralen
02a9324fa5 fix: prevent sync server hang and port retry failure on Windows
Two fixes for Windows-specific sync test failures observed in CI run
58479384622:

1. Add 30-second read timeout to sync server TCP connections
   (cli/sync_server.rs). The server handles connections sequentially;
   without a timeout, a stalled TCP connection blocks read() indefinitely,
   starving subsequent connections. Reproduced on Windows 11: without
   the fix tests hang; with the timeout all 9 sync tests pass (277s
   as timeouts fire and recover). Linux is unaffected due to cleaner
   TCP teardown.

2. Add Windows WSAEADDRINUSE (os error 10048) to the port retry check
   in tests/utils.py. Windows reports this error code instead of the
   Unix "address already in use" string when a port is still in
   TIME_WAIT.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 02:30:01 -05:00
Pekka Enberg
86bd9684f5 Fix Windows Python sync test failing on reserved ports
On Windows, randomly chosen ports can land in OS-reserved ranges
(Hyper-V, WinNAT), causing "os error 10013" (permission denied).
Retry server startup with a different port up to 5 times when a
port-binding error is detected.
2026-02-08 17:04:18 +02:00
Pekka Enberg
bcd4647ce5 Detect sync server process death in Python test health check
The health check loop polled the HTTP endpoint for 30s without ever
checking whether the server process was still alive. If the server
crashed on startup (e.g. port collision), the test silently burned
the full timeout getting "connection refused" before reporting a
useless error.

Check process liveness each iteration so we fail immediately with
the actual exit code and stderr output.
2026-02-08 14:23:02 +02:00
Pekka Enberg
3fe9edec53 python: Add timeouts to prevent sync tests from hanging on Windows CI
The test_bootstrap_concurrency test hangs indefinitely on Windows because
multiprocessing.Barrier.wait() and Process.join() have no timeouts. Also
add a 30s deadline to the TursoServer startup wait loop and per-request
timeouts to requests.get().
2026-02-06 14:21:27 +02:00
Nikita Sivukhin
28094f4b0b fix python bindings 2025-12-26 17:22:34 +04:00
Nikita Sivukhin
9032c61e52 reformat python 2025-12-18 16:39:25 +04:00
Nikita Sivukhin
7fc026d0db add local mode for python and go tests 2025-12-18 16:25:29 +04:00