@@ -549,6 +549,8 @@ async def consumer(task, args):
549
549
event , callidx = await task .wait ()
550
550
assert (event == EventCode .CALL_DONE )
551
551
assert (callidx == 1 )
552
+ assert (task .num_async_subtasks == 1 )
553
+ await canon_subtask_drop (task , callidx )
552
554
assert (task .num_async_subtasks == 0 )
553
555
554
556
dtor_fut = asyncio .Future ()
@@ -571,6 +573,7 @@ async def dtor(task, args):
571
573
event , callidx = await task .wait ()
572
574
assert (event == AsyncCallState .DONE )
573
575
assert (callidx == 1 )
576
+ await canon_subtask_drop (task , callidx )
574
577
assert (task .num_async_subtasks == 0 )
575
578
576
579
[] = await canon_task_return (task , CoreFuncType (['i32' ],[]), [42 ])
@@ -632,6 +635,7 @@ async def callback(task, args):
632
635
if args [0 ] == 42 :
633
636
assert (args [1 ] == EventCode .CALL_DONE )
634
637
assert (args [2 ] == 1 )
638
+ await canon_subtask_drop (task , 1 )
635
639
return [53 ]
636
640
elif args [0 ] == 52 :
637
641
assert (args [1 ] == EventCode .YIELDED )
@@ -642,6 +646,7 @@ async def callback(task, args):
642
646
assert (args [0 ] == 62 )
643
647
assert (args [1 ] == EventCode .CALL_DONE )
644
648
assert (args [2 ] == 2 )
649
+ await canon_subtask_drop (task , 2 )
645
650
[] = await canon_task_return (task , CoreFuncType (['i32' ],[]), [83 ])
646
651
return [0 ]
647
652
@@ -708,6 +713,7 @@ async def consumer(task, args):
708
713
event , callidx = await task .wait ()
709
714
assert (event == EventCode .CALL_DONE )
710
715
assert (callidx == 1 )
716
+ await canon_subtask_drop (task , callidx )
711
717
assert (producer1_done == True )
712
718
713
719
assert (producer2_done == False )
@@ -716,6 +722,7 @@ async def consumer(task, args):
716
722
event , callidx = task .poll ()
717
723
assert (event == EventCode .CALL_DONE )
718
724
assert (callidx == 2 )
725
+ await canon_subtask_drop (task , callidx )
719
726
assert (producer2_done == True )
720
727
721
728
assert (task .poll () is None )
@@ -796,6 +803,9 @@ async def consumer(task, args):
796
803
assert (callidx == 2 )
797
804
assert (producer2_done == True )
798
805
806
+ await canon_subtask_drop (task , 1 )
807
+ await canon_subtask_drop (task , 2 )
808
+
799
809
assert (task .poll () is None )
800
810
801
811
await canon_task_start (task , CoreFuncType ([],[]), [])
@@ -851,6 +861,10 @@ async def core_func(task, args):
851
861
event , callidx = await task .wait ()
852
862
assert (event == EventCode .CALL_DONE )
853
863
assert (callidx == 2 )
864
+
865
+ await canon_subtask_drop (task , 1 )
866
+ await canon_subtask_drop (task , 2 )
867
+
854
868
return []
855
869
856
870
inst = ComponentInstance ()
0 commit comments