diff options
author | Damien George <damien@micropython.org> | 2022-05-03 22:39:58 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-05-03 22:53:12 +1000 |
commit | c90f097519c7342a128848bf9dc5b38ba75d4222 (patch) | |
tree | df9c67263d9fa2cd3c7d97f893147825a2a22e1c /tests/extmod/uasyncio_wait_task.py | |
parent | 0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade (diff) | |
download | micropython-c90f097519c7342a128848bf9dc5b38ba75d4222.tar.gz micropython-c90f097519c7342a128848bf9dc5b38ba75d4222.zip |
tests/extmod: Increase timing on uasyncio tests to make more reliable.
Non-real-time systems like Windows, Linux and macOS do not have reliable
timing, so increase the sleep intervals to make these tests more likely to
pass.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/uasyncio_wait_task.py')
-rw-r--r-- | tests/extmod/uasyncio_wait_task.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/extmod/uasyncio_wait_task.py b/tests/extmod/uasyncio_wait_task.py index 3c79320c9f..e19e29903c 100644 --- a/tests/extmod/uasyncio_wait_task.py +++ b/tests/extmod/uasyncio_wait_task.py @@ -54,8 +54,8 @@ async def main(): print("----") # Create 2 tasks - ts1 = asyncio.create_task(delay_print(0.04, "hello")) - ts2 = asyncio.create_task(delay_print(0.08, "world")) + ts1 = asyncio.create_task(delay_print(0.2, "hello")) + ts2 = asyncio.create_task(delay_print(0.4, "world")) # Time how long the tasks take to finish, they should execute in parallel print("start") @@ -64,7 +64,7 @@ async def main(): t1 = ticks() await ts2 t2 = ticks() - print("took {} {}".format(round(ticks_diff(t1, t0), -1), round(ticks_diff(t2, t1), -1))) + print("took {} {}".format(round(ticks_diff(t1, t0), -2), round(ticks_diff(t2, t1), -2))) # Wait on a task that raises an exception t = asyncio.create_task(task_raise()) |