2126
}
2127
2129
>
branchToken, snapshot, events := s.CreateWorkflow(
2130
>
rand.Int63(),
2131
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
2132
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
2133
>
rand.Int63(),
2134
>
)
2135
>
2136
>
setSnapshot, _ := RandomSnapshot(
2137
>
s.T(),
2138
>
s.NamespaceID,
2139
>
s.WorkflowID,
2140
>
s.RunID,
2141
>
snapshot.NextEventID,
2142
>
rand.Int63(),
2143
>
enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING,
2144
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
2145
>
rand.Int63(),
2146
>
branchToken,
2147
>
)
2148
>
_, err := s.ExecutionManager.SetWorkflowExecution(s.Ctx, &p.SetWorkflowExecutionRequest{
2149
>
ShardID: s.ShardID,
2150
>
RangeID: s.RangeID,
2151
>
2152
>
ArchetypeID: chasm.WorkflowArchetypeID,
2153
>
2154
>
SetWorkflowSnapshot: *setSnapshot,
2155
>
})
2156
>
s.IsType(&p.WorkflowConditionFailedError{}, err)
2157
>
2158
>
s.AssertMSEqualWithDB(chasm.WorkflowArchetypeID, snapshot)
2159
>
s.AssertHEEqualWithDB(branchToken, events)
2160
>
}
2161
2162
func (s *ExecutionMutableStateSuite) TestSet() {