tests/extmod: Make uasyncio_heaplock test more deterministic.
This helps the test pass on systems with an inaccurate sleep time. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
2dc4f843bc
commit
180c54d6cc
@ -29,15 +29,15 @@ async def task(id, n, t):
|
|||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
t1 = asyncio.create_task(task(1, 4, 10))
|
t1 = asyncio.create_task(task(1, 4, 20))
|
||||||
t2 = asyncio.create_task(task(2, 4, 25))
|
t2 = asyncio.create_task(task(2, 2, 50))
|
||||||
|
|
||||||
micropython.heap_lock()
|
micropython.heap_lock()
|
||||||
|
|
||||||
print("start")
|
print("start")
|
||||||
await asyncio.sleep_ms(1)
|
await asyncio.sleep_ms(1)
|
||||||
print("sleep")
|
print("sleep")
|
||||||
await asyncio.sleep_ms(100)
|
await asyncio.sleep_ms(70)
|
||||||
print("finish")
|
print("finish")
|
||||||
|
|
||||||
micropython.heap_unlock()
|
micropython.heap_unlock()
|
||||||
|
@ -6,6 +6,4 @@ sleep
|
|||||||
1 2
|
1 2
|
||||||
2 1
|
2 1
|
||||||
1 3
|
1 3
|
||||||
2 2
|
|
||||||
2 3
|
|
||||||
finish
|
finish
|
||||||
|
Loading…
Reference in New Issue
Block a user