2229
}
2230
2232
>
branchToken, newSnapshot, newEvents := s.CreateWorkflow(
2233
>
rand.Int63(),
2234
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
2235
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
2236
>
rand.Int63(),
2237
>
)
2238
>
2239
>
err := s.ExecutionManager.DeleteCurrentWorkflowExecution(s.Ctx, &p.DeleteCurrentWorkflowExecutionRequest{
2240
>
ShardID: s.ShardID,
2241
>
NamespaceID: s.NamespaceID,
2242
>
WorkflowID: s.WorkflowID,
2243
>
RunID: s.RunID,
2244
>
ArchetypeID: chasm.WorkflowArchetypeID,
2245
>
})
2246
>
s.NoError(err)
2247
>
2248
>
_, err = s.ExecutionManager.GetCurrentExecution(s.Ctx, &p.GetCurrentExecutionRequest{
2249
>
ShardID: s.ShardID,
2250
>
NamespaceID: s.NamespaceID,
2251
>
WorkflowID: s.WorkflowID,
2252
>
ArchetypeID: chasm.WorkflowArchetypeID,
2253
>
})
2254
>
s.IsType(&serviceerror.NotFound{}, err)
2255
>
s.EqualError(err, "workflow not found for ID: "+s.WorkflowID)
2256
>
2257
>
s.AssertMSEqualWithDB(chasm.WorkflowArchetypeID, newSnapshot)
2258
>
s.AssertHEEqualWithDB(branchToken, newEvents)
2259
>
}
2260
2261
func (s *ExecutionMutableStateSuite) TestDeleteCurrent_NotCurrent() {