diff options
Diffstat (limited to 'tests/extmod/uasyncio_gather.py')
| -rw-r--r-- | tests/extmod/uasyncio_gather.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/extmod/uasyncio_gather.py b/tests/extmod/uasyncio_gather.py index fb47e753f..c081221c9 100644 --- a/tests/extmod/uasyncio_gather.py +++ b/tests/extmod/uasyncio_gather.py @@ -20,7 +20,7 @@ async def factorial(name, number): return f -async def task(id, t=0.02): +async def task(id, t=0.1): print("start", id) await asyncio.sleep(t) print("end", id) @@ -30,11 +30,11 @@ async def task(id, t=0.02): async def task_loop(id): print("task_loop start", id) while True: - await asyncio.sleep(0.02) + await asyncio.sleep(0.1) print("task_loop loop", id) -async def task_raise(id, t=0.02): +async def task_raise(id, t=0.1): print("task_raise start", id) await asyncio.sleep(t) print("task_raise raise", id) @@ -75,7 +75,7 @@ async def main(): print(tasks[0].done(), tasks[1].done()) for t in tasks: t.cancel() - await asyncio.sleep(0.04) + await asyncio.sleep(0.2) print("====") @@ -92,9 +92,9 @@ async def main(): # Cancel a multi gather. t = asyncio.create_task(gather_task(task(1), task(2))) - await asyncio.sleep(0.01) + await asyncio.sleep(0.05) t.cancel() - await asyncio.sleep(0.04) + await asyncio.sleep(0.2) # Test edge cases where the gather is cancelled just as tasks are created and ending. for i in range(1, 4): |
