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.
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>
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.
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.
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().