561
}
562
564
>
s.CreateWorkflow(
565
>
rand.Int63(),
566
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
567
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
568
>
rand.Int63(),
569
>
)
570
>
571
>
// Mutation for a different run of the same workflowID
572
>
// not related to the workflow created above
573
>
newRunID := uuid.New().String()
574
>
newBranchToken := RandomBranchToken(s.NamespaceID, s.WorkflowID, newRunID, s.HistoryBranchUtil)
575
>
currentMutation, currentEvents := RandomMutation(
576
>
s.T(),
577
>
s.NamespaceID,
578
>
s.WorkflowID,
579
>
newRunID,
580
>
rand.Int63(),
581
>
rand.Int63(),
582
>
enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING,
583
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
584
>
rand.Int63(),
585
>
newBranchToken,
586
>
)
587
>
_, err := s.ExecutionManager.UpdateWorkflowExecution(s.Ctx, &p.UpdateWorkflowExecutionRequest{
588
>
ShardID: s.ShardID,
589
>
RangeID: s.RangeID,
590
>
Mode: p.UpdateWorkflowModeUpdateCurrent,
591
>
592
>
ArchetypeID: chasm.WorkflowArchetypeID,
593
>
594
>
UpdateWorkflowMutation: *currentMutation,
595
>
UpdateWorkflowEvents: currentEvents,
596
>
597
>
NewWorkflowSnapshot: nil,
598
>
NewWorkflowEvents: nil,
599
>
})
600
>
s.IsType(&p.CurrentWorkflowConditionFailedError{}, err)
601
>
602
>
s.AssertMissingFromDB(
603
>
currentMutation.ExecutionInfo.NamespaceId,
604
>
currentMutation.ExecutionInfo.WorkflowId,
605
>
currentMutation.ExecutionState.RunId,
606
>
chasm.WorkflowArchetypeID,
607
>
)
608
>
}
609
610
func (s *ExecutionMutableStateSuite) TestUpdate_NotZombie_Conflict() {