521
}
522
524
>
archetypeID := rand.Uint32()
525
>
newSnapshot := s.CreateCHASMExecution(
526
>
rand.Int63(),
527
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
528
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
529
>
rand.Int63(),
530
>
archetypeID,
531
>
)
532
>
533
>
currentMutation, currentEvents := RandomMutation(
534
>
s.T(),
535
>
s.NamespaceID,
536
>
s.WorkflowID,
537
>
s.RunID,
538
>
newSnapshot.NextEventID,
539
>
rand.Int63(),
540
>
enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING,
541
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
542
>
newSnapshot.DBRecordVersion+1,
543
>
nil, // No branch token for CHASM
544
>
)
545
>
_, err := s.ExecutionManager.UpdateWorkflowExecution(s.Ctx, &p.UpdateWorkflowExecutionRequest{
546
>
ShardID: s.ShardID,
547
>
RangeID: s.RangeID,
548
>
Mode: p.UpdateWorkflowModeUpdateCurrent,
549
>
550
>
ArchetypeID: archetypeID,
551
>
552
>
UpdateWorkflowMutation: *currentMutation,
553
>
UpdateWorkflowEvents: currentEvents,
554
>
555
>
NewWorkflowSnapshot: nil,
556
>
NewWorkflowEvents: nil,
557
>
})
558
>
s.NoError(err)
559
>
560
>
s.AssertMSEqualWithDB(archetypeID, newSnapshot, currentMutation)
561
>
}
562
563
func (s *ExecutionMutableStateSuite) TestUpdate_NotZombie_CurrentConflict() {