Skip to content

Commit

Permalink
test deferred asert same by seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaChuvaev committed Mar 16, 2024
1 parent 45f8694 commit b5db9d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_deferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def test_deferred() -> None:
await queue.register(
DropBucket,
BucketRequest(1),
defer=timedelta(milliseconds=10),
defer=timedelta(seconds=2),
)

deferred_pipe: str = Tube(DeferredHandler, Route()).pipe
Expand All @@ -39,7 +39,7 @@ async def test_deferred() -> None:
await queue.register(
DropBucket,
BucketRequest(1),
defer=timedelta(milliseconds=5),
defer=timedelta(seconds=1),
)

assert await queue.storage.length(drop_pipe) == 0
Expand All @@ -54,7 +54,7 @@ async def test_deferred() -> None:
timestamp_order = await queue.storage.range(deferred_pipe, 2)
assert list(reversed(append_order)) == timestamp_order

await sleep(0.01)
await sleep(2)

await worker.loop(2)
assert await queue.storage.length(drop_pipe) == 1
Expand Down

0 comments on commit b5db9d1

Please sign in to comment.