diff options
author | Damien George <damien@micropython.org> | 2020-08-20 23:13:25 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-08-22 12:17:06 +1000 |
commit | 55c76eaac12af4e93f8de11bb25c835e8b65c623 (patch) | |
tree | cf3e4d1ccad90737a076548dddbc84acb8c5dbc6 /tests/extmod/uasyncio_fair.py | |
parent | 20948a3d54ff560a3d029b8bfc9761dcbbad9312 (diff) | |
download | micropython-55c76eaac12af4e93f8de11bb25c835e8b65c623.tar.gz micropython-55c76eaac12af4e93f8de11bb25c835e8b65c623.zip |
extmod/uasyncio: Truncate negative sleeps to 0.
Otherwise a task that continuously awaits on a large negative sleep can
monopolise the scheduler (because its wake time is always less than
everything else in the pairing heap).
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/uasyncio_fair.py')
-rw-r--r-- | tests/extmod/uasyncio_fair.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/extmod/uasyncio_fair.py b/tests/extmod/uasyncio_fair.py index 9b04454bc1..e0ee811a9b 100644 --- a/tests/extmod/uasyncio_fair.py +++ b/tests/extmod/uasyncio_fair.py @@ -22,6 +22,7 @@ async def main(): t1 = asyncio.create_task(task(1, -0.01)) t2 = asyncio.create_task(task(2, 0.1)) t3 = asyncio.create_task(task(3, 0.2)) + t3 = asyncio.create_task(task(4, -100)) await asyncio.sleep(0.5) t1.cancel() t2.cancel() |