@@ -549,6 +549,8 @@ async def consumer(task, args):
549549 event , callidx = await task .wait ()
550550 assert (event == EventCode .CALL_DONE )
551551 assert (callidx == 1 )
552+ assert (task .num_async_subtasks == 1 )
553+ await canon_subtask_drop (task , callidx )
552554 assert (task .num_async_subtasks == 0 )
553555
554556 dtor_fut = asyncio .Future ()
@@ -571,6 +573,7 @@ async def dtor(task, args):
571573 event , callidx = await task .wait ()
572574 assert (event == AsyncCallState .DONE )
573575 assert (callidx == 1 )
576+ await canon_subtask_drop (task , callidx )
574577 assert (task .num_async_subtasks == 0 )
575578
576579 [] = await canon_task_return (task , CoreFuncType (['i32' ],[]), [42 ])
@@ -632,6 +635,7 @@ async def callback(task, args):
632635 if args [0 ] == 42 :
633636 assert (args [1 ] == EventCode .CALL_DONE )
634637 assert (args [2 ] == 1 )
638+ await canon_subtask_drop (task , 1 )
635639 return [53 ]
636640 elif args [0 ] == 52 :
637641 assert (args [1 ] == EventCode .YIELDED )
@@ -642,6 +646,7 @@ async def callback(task, args):
642646 assert (args [0 ] == 62 )
643647 assert (args [1 ] == EventCode .CALL_DONE )
644648 assert (args [2 ] == 2 )
649+ await canon_subtask_drop (task , 2 )
645650 [] = await canon_task_return (task , CoreFuncType (['i32' ],[]), [83 ])
646651 return [0 ]
647652
@@ -708,6 +713,7 @@ async def consumer(task, args):
708713 event , callidx = await task .wait ()
709714 assert (event == EventCode .CALL_DONE )
710715 assert (callidx == 1 )
716+ await canon_subtask_drop (task , callidx )
711717 assert (producer1_done == True )
712718
713719 assert (producer2_done == False )
@@ -716,6 +722,7 @@ async def consumer(task, args):
716722 event , callidx = task .poll ()
717723 assert (event == EventCode .CALL_DONE )
718724 assert (callidx == 2 )
725+ await canon_subtask_drop (task , callidx )
719726 assert (producer2_done == True )
720727
721728 assert (task .poll () is None )
@@ -796,6 +803,9 @@ async def consumer(task, args):
796803 assert (callidx == 2 )
797804 assert (producer2_done == True )
798805
806+ await canon_subtask_drop (task , 1 )
807+ await canon_subtask_drop (task , 2 )
808+
799809 assert (task .poll () is None )
800810
801811 await canon_task_start (task , CoreFuncType ([],[]), [])
@@ -851,6 +861,10 @@ async def core_func(task, args):
851861 event , callidx = await task .wait ()
852862 assert (event == EventCode .CALL_DONE )
853863 assert (callidx == 2 )
864+
865+ await canon_subtask_drop (task , 1 )
866+ await canon_subtask_drop (task , 2 )
867+
854868 return []
855869
856870 inst = ComponentInstance ()
0 commit comments