Skip to content

Commit

Permalink
update timing of flaky acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyann committed Oct 19, 2024
1 parent ea37f88 commit 5ffd414
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/acceptance/test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ async def test_abort(async_app):
@async_app.task(queue="default", name="task1", pass_context=True)
async def task1(context):
while True:
await asyncio.sleep(0.1)
await asyncio.sleep(0.02)
if await context.should_abort_async():
raise JobAborted

@async_app.task(queue="default", name="task2", pass_context=True)
def task2(context):
while True:
time.sleep(0.1)
time.sleep(0.02)
if context.should_abort():
raise JobAborted

Expand All @@ -130,11 +130,11 @@ def task2(context):
async_app.run_worker_async(queues=["default"], wait=False)
)

await asyncio.sleep(0.1)
await asyncio.sleep(0.05)
result = await async_app.job_manager.cancel_job_by_id_async(job1_id, abort=True)
assert result is True

await asyncio.sleep(0.1)
await asyncio.sleep(0.05)
result = await async_app.job_manager.cancel_job_by_id_async(job2_id, abort=True)
assert result is True

Expand Down

0 comments on commit 5ffd414

Please sign in to comment.