@@ -5502,12 +5502,11 @@ async def _get_workflow_result(
5502
5502
await handle .signal (handler_name )
5503
5503
else :
5504
5504
if not wait_all_handlers_finished :
5505
- with pytest .raises (RPCError ) as err :
5505
+ with pytest .raises (WorkflowUpdateFailedError ) as err_info :
5506
5506
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"
5511
5510
else :
5512
5511
await handle .execute_update (handler_name , id = "my-update" )
5513
5512
@@ -5736,11 +5735,12 @@ async def _run_workflow_and_get_warning(self) -> bool:
5736
5735
if self .handler_waiting == "-wait-all-handlers-finish-" :
5737
5736
await update_task
5738
5737
else :
5739
- with pytest .raises (RPCError ) as update_err :
5738
+ with pytest .raises (WorkflowUpdateFailedError ) as err_info :
5740
5739
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"
5744
5744
)
5745
5745
5746
5746
with pytest .raises (WorkflowFailureError ) as err :
0 commit comments