Skip to content

Commit ec0290a

Browse files
committed
De-flake test_refresh_extends_lease on slower CI runners
Bump ttl from 0.15s to 2.0s and contender timeout from 0.05s to 0.1s so scheduling jitter between the last refresh and the contender.acquire on Windows CI can't let the lease lapse. Sleep duration stays at 3 x 0.05s so the test still exercises three refresh rounds.
1 parent e14fc05 commit ec0290a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_sqlite_lock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ def test_release_does_not_affect_other_owner(tmp_path: Path) -> None:
7777

7878
def test_refresh_extends_lease(tmp_path: Path) -> None:
7979
db = tmp_path / "refresh.sqlite"
80-
holder = SQLiteLock(db, "keep", ttl=0.15)
80+
holder = SQLiteLock(db, "keep", ttl=2.0)
8181
holder.acquire()
8282
try:
8383
for _ in range(3):
8484
time.sleep(0.05)
8585
holder.refresh()
86-
contender = SQLiteLock(db, "keep", timeout=0.05)
86+
contender = SQLiteLock(db, "keep", timeout=0.1)
8787
with pytest.raises(LockTimeoutException):
8888
contender.acquire()
8989
finally:

0 commit comments

Comments
 (0)