@@ -949,6 +949,8 @@ async def test_workflow_cancel_activity(client: Client, local: bool):
949949 async with new_worker (
950950 client , CancelActivityWorkflow , activities = [activity_inst .wait_cancel ]
951951 ) as worker :
952+ print ("Start first workflow" )
953+
952954 # Try cancel - confirm error and activity was sent the cancel
953955 handle = await client .start_workflow (
954956 CancelActivityWorkflow .run ,
@@ -964,12 +966,18 @@ async def test_workflow_cancel_activity(client: Client, local: bool):
964966 async def activity_result () -> str :
965967 return await handle .query (CancelActivityWorkflow .activity_result )
966968
969+ print ("Wait for cancelled" )
967970 await assert_eq_eventually (
968971 "Error: CancelledError" , activity_result , timeout = assert_timeout
969972 )
973+
974+ print ("Wait for activity complete" )
970975 await activity_inst .wait_cancel_complete .wait ()
976+
977+ print ("Wait for workflow cancel" )
971978 await handle .cancel ()
972979
980+ print ("Start second workflow" )
973981 # Wait cancel - confirm no error due to graceful cancel handling
974982 handle = await client .start_workflow (
975983 CancelActivityWorkflow .run ,
@@ -981,14 +989,18 @@ async def activity_result() -> str:
981989 task_queue = worker .task_queue ,
982990 task_timeout = task_timeout ,
983991 )
992+ print ("Wait for cancelled" )
984993 await assert_eq_eventually (
985994 "Got cancelled error, cancelled? True" ,
986995 activity_result ,
987996 timeout = assert_timeout ,
988997 )
998+ print ("Wait for activity complete" )
989999 await activity_inst .wait_cancel_complete .wait ()
1000+ print ("Wait for workflow cancel" )
9901001 await handle .cancel ()
9911002
1003+ print ("Start third workflow" )
9921004 # Abandon - confirm error and that activity stays running
9931005 handle = await client .start_workflow (
9941006 CancelActivityWorkflow .run ,
@@ -1000,12 +1012,16 @@ async def activity_result() -> str:
10001012 task_queue = worker .task_queue ,
10011013 task_timeout = task_timeout ,
10021014 )
1015+ print ("Wait for cancelled" )
10031016 await assert_eq_eventually (
10041017 "Error: CancelledError" , activity_result , timeout = assert_timeout
10051018 )
1019+ print ("sleep" )
10061020 await asyncio .sleep (0.5 )
10071021 assert not activity_inst .wait_cancel_complete .is_set ()
1022+ print ("Wait for workflow cancel" )
10081023 await handle .cancel ()
1024+ print ("Wait for activity complete" )
10091025 await activity_inst .wait_cancel_complete .wait ()
10101026
10111027
0 commit comments