770
}
771
773
>
branchToken, newSnapshot, newEvents := s.CreateWorkflow(
774
>
rand.Int63(),
775
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
776
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
777
>
rand.Int63(),
778
>
)
779
>
780
>
currentMutation, currentEvents := RandomMutation(
781
>
s.T(),
782
>
s.NamespaceID,
783
>
s.WorkflowID,
784
>
s.RunID,
785
>
newSnapshot.NextEventID,
786
>
rand.Int63(),
787
>
enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE,
788
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
789
>
newSnapshot.DBRecordVersion+1,
790
>
branchToken,
791
>
)
792
>
_, err := s.ExecutionManager.UpdateWorkflowExecution(s.Ctx, &p.UpdateWorkflowExecutionRequest{
793
>
ShardID: s.ShardID,
794
>
RangeID: s.RangeID,
795
>
Mode: p.UpdateWorkflowModeBypassCurrent,
796
>
797
>
ArchetypeID: chasm.WorkflowArchetypeID,
798
>
799
>
UpdateWorkflowMutation: *currentMutation,
800
>
UpdateWorkflowEvents: currentEvents,
801
>
802
>
NewWorkflowSnapshot: nil,
803
>
NewWorkflowEvents: nil,
804
>
})
805
>
s.IsType(&p.CurrentWorkflowConditionFailedError{}, err)
806
>
807
>
s.AssertMSEqualWithDB(chasm.WorkflowArchetypeID, newSnapshot)
808
>
s.AssertHEPrefixWithDB(branchToken, newEvents)
809
>
}
810
811
func (s *ExecutionMutableStateSuite) TestUpdate_Zombie_Conflict() {