862
863
// TestGetWorkflowExecution test
865
>
testNamespaceUUID := namespace.ID(uuid.NewString())
866
>
closeTime := time.Now().UTC()
867
>
startTime := closeTime.Add(-5 * time.Second)
868
>
869
>
var startRequests []*manager.RecordWorkflowExecutionStartedRequest
870
>
for range 5 {
871
>
startRequests = append(
872
>
startRequests,
873
>
s.createOpenWorkflowRecord(
874
>
testNamespaceUUID,
875
>
"visibility-workflow-test",
876
>
"visibility-workflow",
877
>
startTime,
878
>
startTime,
879
>
"test-queue",
880
>
),
881
>
)
882
>
}
883
>
for _, req := range startRequests {
884
>
resp, err := s.VisibilityMgr.GetWorkflowExecution(
885
>
s.ctx,
886
>
&manager.GetWorkflowExecutionRequest{
887
>
NamespaceID: testNamespaceUUID,
888
>
RunID: req.Execution.RunId,
889
>
},
890
>
)
891
>
s.NoError(err)
892
>
s.assertOpenExecutionEquals(req, resp.Execution)
893
>
}
894
896
>
for _, startReq := range startRequests {
897
>
closeRequests = append(
898
>
closeRequests,
899
>
s.createClosedWorkflowRecord(startReq, closeTime, enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED),
900
>
)
901
>
}
902
>
for _, req := range closeRequests {
903
>
resp, err := s.VisibilityMgr.GetWorkflowExecution(
904
>
s.ctx,
905
>
&manager.GetWorkflowExecutionRequest{
906
>
NamespaceID: testNamespaceUUID,
907
>
RunID: req.Execution.RunId,
908
>
},
909
>
)
910
>
s.NoError(err)
911
>
s.assertClosedExecutionEquals(req, resp.Execution)
912
>
}
913
}
914