Skip to content

Respond to server changes to Update error #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/worker/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5502,12 +5502,11 @@ async def _get_workflow_result(
await handle.signal(handler_name)
else:
if not wait_all_handlers_finished:
with pytest.raises(RPCError) as err:
with pytest.raises(WorkflowUpdateFailedError) as err_info:
await handle.execute_update(handler_name, id="my-update")
assert (
err.value.status == RPCStatusCode.NOT_FOUND
and "workflow execution already completed" in str(err.value).lower()
)
update_err = err_info.value
assert isinstance(update_err.cause, ApplicationError)
assert update_err.cause.type == "AcceptedUpdateCompletedWorkflow"
else:
await handle.execute_update(handler_name, id="my-update")

Expand Down Expand Up @@ -5736,11 +5735,12 @@ async def _run_workflow_and_get_warning(self) -> bool:
if self.handler_waiting == "-wait-all-handlers-finish-":
await update_task
else:
with pytest.raises(RPCError) as update_err:
with pytest.raises(WorkflowUpdateFailedError) as err_info:
await update_task
assert update_err.value.status == RPCStatusCode.NOT_FOUND and (
str(update_err.value).lower()
== "workflow execution already completed"
update_err = err_info.value
assert isinstance(update_err.cause, ApplicationError)
assert (
update_err.cause.type == "AcceptedUpdateCompletedWorkflow"
)

with pytest.raises(WorkflowFailureError) as err:
Expand Down
Loading