Skip to content

Commit af8be8c

Browse files
committed
test: make lock-propagation comment more concise
1 parent a1b0df7 commit af8be8c

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

tests/integration/test_request_queue.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,9 @@ async def test_request_queue_unlock_requests(client: ApifyClient | ApifyClientAs
563563
assert len(lock_response.items) == 3
564564
locked_ids = {item.id for item in lock_response.items}
565565

566-
# Wait for the locks to propagate before unlocking (eventual consistency): the lock-head response
567-
# is acknowledged before all three lock writes are visible to subsequent reads, so unlocking
568-
# immediately can see fewer locks than were just acquired. Locked requests are excluded from the
569-
# queue head, so poll `list_head` until none of the locked requests reappear there, rather than
570-
# guessing a fixed sleep. Note this is a best-effort mitigation: the head read and the unlock may
571-
# be served by different replicas, so convergence of one does not guarantee the other — but it
572-
# narrows the race window enough in practice.
566+
# Locks are acknowledged before they are visible to subsequent reads, so unlocking immediately can
567+
# see fewer locks than were just acquired. Since locked requests are excluded from the queue head,
568+
# poll `list_head` until the locked IDs disappear from it (best-effort mitigation of the race).
573569
async def all_locks_visible() -> bool:
574570
head = await maybe_await(rq_client.list_head(limit=5))
575571
assert isinstance(head, RequestQueueHead)

0 commit comments

Comments
 (0)