fix: increase file lock acquisition timeout to prevent flaky concurrent lock test timeouts on Windows

This commit is contained in:
Violin
2026-07-16 18:24:57 +01:00
parent b02d8eb68f
commit 1c5bfb9ba2
+2 -2
View File
@@ -44,8 +44,8 @@ def lock_file(path: Path) -> FileLock:
# Blocking fallback: wait for the lock to free.
fcntl.flock(fh.fileno(), fcntl.LOCK_EX)
elif msvcrt is not None:
# msvcrt has no non-blocking mode; retry briefly.
deadline = time.monotonic() + 5.0
# msvcrt has no non-blocking mode; retry with a generous timeout.
deadline = time.monotonic() + 20.0
while True:
try:
msvcrt.locking(fh.fileno(), msvcrt.LK_NBLCK, 1)