Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sourBz committed Jan 6, 2025
1 parent 7fc4250 commit b820c8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_is_empty(task_queue: TaskQueue):

def test_complete(task_queue: TaskQueue):
# boring case
task_queue.add({"foo": 1}, LEASE_TIMEOUT, ttl=1)
task_queue.add({"foo": 1}, LEASE_TIMEOUT + 0.1, ttl=1)
_, id_, qname = task_queue.get()
assert not task_queue.is_empty()
assert qname == "test_queue"
Expand All @@ -100,7 +100,7 @@ def test_complete(task_queue: TaskQueue):


def test_expired(task_queue: TaskQueue):
task_queue.add({"foo": 1}, LEASE_TIMEOUT, ttl=1)
task_queue.add({"foo": 1}, LEASE_TIMEOUT + 0.1, ttl=1)
task_queue.get()
assert not task_queue.is_empty()
time.sleep(LEASE_TIMEOUT + 0.1)
Expand All @@ -113,7 +113,7 @@ def test_expired(task_queue: TaskQueue):
while not task_queue.is_empty():
task_queue.get()
tend = time.time()
assert tend - tstart > LEASE_TIMEOUT
assert tend - tstart > LEASE_TIMEOUT * 5


def test_ttl(task_queue: TaskQueue, caplog: LogCaptureFixture):
Expand Down

0 comments on commit b820c8d

Please sign in to comment.