Hello,
I have a workflow that starts a child workflow like this
options := workflow.ChildWorkflowOptions{
WorkflowID: "ID",
ParentClosePolicy: enums.PARENT_CLOSE_POLICY_ABANDON,
}
ctxChild := workflow.WithChildOptions(ctx, options)
err = workflow.ExecuteChildWorkflow(ctxChild, childWorkflowFunc, params).GetChildWorkflowExecution().Get(ctx, nil)
if err != nil {
return stacktrace.Propagate(err, "Failed to start child workflow")
}
Then on my tests I’m trying to assert that the child WF is effectively running with parent close policy provided. One way I found to test this was through:
env.SetOnChildWorkflowStartedListener(func(workflowInfo *workflow.Info, ctx workflow.Context, args converter.EncodedValues) {
if workflowInfo.WorkflowType.Name == "ChildWF" {
options := workflow.GetChildWorkflowOptions(ctx)
_ = options.ParentClosePolicy
}
})
It seems like workflow.Info has the correct information about my childWF but workflow.GetChildWorkflowOptions(ctx) is always empty which is a consequence of this information not being in the context for some reason despite being injected in the WF execution. Am I missing something here? Is there a better way to test this?