(sets int, tqName string)
| 1123 | } |
| 1124 | |
| 1125 | func (s *taskQueueStatsContext) enqueueWorkflows(sets int, tqName string) int { |
| 1126 | deploymentOpts := s.deploymentOptions(tqName) |
| 1127 | |
| 1128 | var total int |
| 1129 | for version := range 2 { // 0=unversioned, 1=versioned |
| 1130 | for priority := 0; priority <= s.maxPriority; priority++ { |
| 1131 | for range sets { |
| 1132 | wt := "functional-workflow-multiple-tasks" |
| 1133 | workflowType := &commonpb.WorkflowType{Name: wt} |
| 1134 | |
| 1135 | request := &workflowservice.StartWorkflowExecutionRequest{ |
| 1136 | Namespace: s.Namespace().String(), |
| 1137 | WorkflowId: uuid.NewString(), |
| 1138 | WorkflowType: workflowType, |
| 1139 | TaskQueue: &taskqueuepb.TaskQueue{Name: tqName, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, |
| 1140 | Input: nil, |
| 1141 | WorkflowRunTimeout: durationpb.New(10 * time.Minute), |
| 1142 | WorkflowTaskTimeout: durationpb.New(10 * time.Minute), |
| 1143 | RequestId: uuid.NewString(), |
| 1144 | WorkflowIdReusePolicy: enumspb.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE, |
| 1145 | Priority: &commonpb.Priority{PriorityKey: int32(priority)}, |
| 1146 | } |
| 1147 | |
| 1148 | if version == 1 { |
| 1149 | request.VersioningOverride = &workflowpb.VersioningOverride{ |
| 1150 | Override: &workflowpb.VersioningOverride_Pinned{ |
| 1151 | Pinned: &workflowpb.VersioningOverride_PinnedOverride{ |
| 1152 | Behavior: workflowpb.VersioningOverride_PINNED_OVERRIDE_BEHAVIOR_PINNED, |
| 1153 | Version: &deploymentpb.WorkerDeploymentVersion{ |
| 1154 | BuildId: deploymentOpts.BuildId, |
| 1155 | DeploymentName: deploymentOpts.DeploymentName, |
| 1156 | }, |
| 1157 | }, |
| 1158 | }, |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | _, err := s.FrontendClient().StartWorkflowExecution(s.ctx, request) |
| 1163 | s.NoError(err) |
| 1164 | |
| 1165 | total++ |
| 1166 | } |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | s.T().Logf("Enqueued %d workflows", total) |
| 1171 | return total |
| 1172 | } |
| 1173 | |
| 1174 | func (s *TaskQueueStatsVersionSuite) createVersionsInTaskQueue(ctx context.Context, env *taskQueueStatsContext, tqName string, deploymentName string, buildID string) { |
| 1175 | go func() { |
no test coverage detected