@@ -5502,12 +5502,11 @@ async def _get_workflow_result(
55025502 await handle .signal (handler_name )
55035503 else :
55045504 if not wait_all_handlers_finished :
5505- with pytest .raises (RPCError ) as err :
5505+ with pytest .raises (WorkflowUpdateFailedError ) as err_info :
55065506 await handle .execute_update (handler_name , id = "my-update" )
5507- assert (
5508- err .value .status == RPCStatusCode .NOT_FOUND
5509- and "workflow execution already completed" in str (err .value ).lower ()
5510- )
5507+ update_err = err_info .value
5508+ assert isinstance (update_err .cause , ApplicationError )
5509+ assert update_err .cause .type == "AcceptedUpdateCompletedWorkflow"
55115510 else :
55125511 await handle .execute_update (handler_name , id = "my-update" )
55135512
@@ -5736,11 +5735,12 @@ async def _run_workflow_and_get_warning(self) -> bool:
57365735 if self .handler_waiting == "-wait-all-handlers-finish-" :
57375736 await update_task
57385737 else :
5739- with pytest .raises (RPCError ) as update_err :
5738+ with pytest .raises (WorkflowUpdateFailedError ) as err_info :
57405739 await update_task
5741- assert update_err .value .status == RPCStatusCode .NOT_FOUND and (
5742- str (update_err .value ).lower ()
5743- == "workflow execution already completed"
5740+ update_err = err_info .value
5741+ assert isinstance (update_err .cause , ApplicationError )
5742+ assert (
5743+ update_err .cause .type == "AcceptedUpdateCompletedWorkflow"
57445744 )
57455745
57465746 with pytest .raises (WorkflowFailureError ) as err :
0 commit comments