Skip to content
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

Workflow outcome is inconsistent between test env and real server #1496

Open
bergundy opened this issue May 30, 2024 · 0 comments
Open

Workflow outcome is inconsistent between test env and real server #1496

bergundy opened this issue May 30, 2024 · 0 comments

Comments

@bergundy
Copy link
Member

When running a workflow that starts a child and cancels it:

wf := func(ctx workflow.Context) error {
	childCtx, cancel := workflow.WithCancel(ctx)
	defer cancel()
	fut := workflow.ExecuteChildWorkflow(childCtx, waitForCancelWorkflow)
	if err := fut.GetChildWorkflowExecution().Get(ctx, nil); err != nil {
		return err
	}
	cancel()
	return fut.Get(ctx, nil)
}

func waitForCancelWorkflow(ctx workflow.Context) error {
	return workflow.Await(ctx, func() bool { return false })
}

I'm getting inconsistent outcomes:

With server:

workflow execution error (type: func1, workflowID: 1eb1f045-b804-429f-b99e-57e45023a6e8, runID: 4821bd7c-b9f6-4684-92be-ab7354eefc36): canceled

With test env:

workflow execution error (type: func1, workflowID: default-test-workflow-id, runID: default-test-run-id): child workflow execution error (type: waitForCancelWorkflow, workflowID: default-test-run-id_1, runID: default-test-run-id_1_RunID, initiatedEventID: 0, startedEventID: 0): canceled

The test env is consistent with the behavior of other SDKs, but it's likely too late to change the cancelation behavior with the real server for consistency. I propose we change the test env to be consistent with the "real" env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant