circuitpython/tests/extmod/uasyncio_gather.py.exp
Damien George 90aaf2dbef extmod/uasyncio: Fix gather cancelling and handling of exceptions.
The following fixes are made:
- cancelling a gather now cancels all sub-tasks of the gather (previously
  it would only cancel the first)
- if any sub-task of a gather raises an exception then the gather finishes
  (previously it would only finish if the first sub-task raised)

Fixes issues #5798, #7807, #7901.

Signed-off-by: Damien George <damien@micropython.org>
2022-03-30 16:07:44 +11:00

35 lines
564 B
Plaintext

Task A: Compute factorial(2)...
Task B: Compute factorial(2)...
Task C: Compute factorial(2)...
Task A: factorial(2) = 2
Task B: Compute factorial(3)...
Task C: Compute factorial(3)...
Task B: factorial(3) = 6
Task C: Compute factorial(4)...
Task C: factorial(4) = 24
[2, 6, 24]
====
start 2
end 2
[CancelledError(), 2]
====
start 1
task_raise start 2
end 1
[1, ValueError(2,)]
====
task_loop start 1
task_raise start 2
task_loop loop 1
ValueError(2,)
False True
====
task_raise start 1
task_raise start 2
ValueError(1,)
True True
====
gather_task
start 1
start 2