608
}
609
611
>
branchToken, newSnapshot, newEvents := s.CreateWorkflow(
612
>
rand.Int63(),
613
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
614
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
615
>
rand.Int63(),
616
>
)
617
>
618
>
currentMutation, currentEvents := RandomMutation(
619
>
s.T(),
620
>
s.NamespaceID,
621
>
s.WorkflowID,
622
>
s.RunID,
623
>
newSnapshot.NextEventID,
624
>
rand.Int63(),
625
>
enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING,
626
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
627
>
rand.Int63(),
628
>
branchToken,
629
>
)
630
>
_, err := s.ExecutionManager.UpdateWorkflowExecution(s.Ctx, &p.UpdateWorkflowExecutionRequest{
631
>
ShardID: s.ShardID,
632
>
RangeID: s.RangeID,
633
>
Mode: p.UpdateWorkflowModeUpdateCurrent,
634
>
635
>
ArchetypeID: chasm.WorkflowArchetypeID,
636
>
637
>
UpdateWorkflowMutation: *currentMutation,
638
>
UpdateWorkflowEvents: currentEvents,
639
>
640
>
NewWorkflowSnapshot: nil,
641
>
NewWorkflowEvents: nil,
642
>
})
643
>
s.IsType(&p.WorkflowConditionFailedError{}, err)
644
>
645
>
s.AssertMSEqualWithDB(chasm.WorkflowArchetypeID, newSnapshot)
646
>
s.AssertHEPrefixWithDB(branchToken, newEvents)
647
>
}
648
649
func (s *ExecutionMutableStateSuite) TestUpdate_NotZombie_WithNew() {