482
}
483
485
>
branchToken, newSnapshot, newEvents := s.CreateWorkflow(
486
>
rand.Int63(),
487
>
enumsspb.WORKFLOW_EXECUTION_STATE_CREATED,
488
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
489
>
rand.Int63(),
490
>
)
491
>
492
>
currentMutation, currentEvents := RandomMutation(
493
>
s.T(),
494
>
s.NamespaceID,
495
>
s.WorkflowID,
496
>
s.RunID,
497
>
newSnapshot.NextEventID,
498
>
rand.Int63(),
499
>
enumsspb.WORKFLOW_EXECUTION_STATE_RUNNING,
500
>
enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING,
501
>
newSnapshot.DBRecordVersion+1,
502
>
branchToken,
503
>
)
504
>
_, err := s.ExecutionManager.UpdateWorkflowExecution(s.Ctx, &p.UpdateWorkflowExecutionRequest{
505
>
ShardID: s.ShardID,
506
>
RangeID: s.RangeID,
507
>
Mode: p.UpdateWorkflowModeUpdateCurrent,
508
>
509
>
ArchetypeID: chasm.WorkflowArchetypeID,
510
>
511
>
UpdateWorkflowMutation: *currentMutation,
512
>
UpdateWorkflowEvents: currentEvents,
513
>
514
>
NewWorkflowSnapshot: nil,
515
>
NewWorkflowEvents: nil,
516
>
})
517
>
s.NoError(err)
518
>
519
>
s.AssertMSEqualWithDB(chasm.WorkflowArchetypeID, newSnapshot, currentMutation)
520
>
s.AssertHEEqualWithDB(branchToken, newEvents, currentEvents)
521
>
}
522
523
func (s *ExecutionMutableStateSuite) TestUpdate_NotZombie_CHASM() {