@@ -345,8 +345,7 @@ func assertQueryDoesNotExecutesOnTablet(t *testing.T, conn *mysql.Conn, tablet *
345
345
}
346
346
347
347
func waitForWorkflowToBeCreated (t * testing.T , vc * VitessCluster , ksWorkflow string ) {
348
- keyspace , workflow , ok := strings .Cut (ksWorkflow , "." )
349
- require .True (t , ok , "invalid <keyspace>.<workflow> value: %s" , ksWorkflow )
348
+ keyspace , workflow := parseKeyspaceWorkflow (t , ksWorkflow )
350
349
require .NoError (t , waitForCondition ("workflow to be created" , func () bool {
351
350
output , err := vc .VtctldClient .ExecuteCommandWithOutput ("Workflow" , "--keyspace" , keyspace , "show" , "--workflow" , workflow , "--compact" , "--include-logs=false" )
352
351
return err == nil && output != emptyWorkflowShowResponse
@@ -359,8 +358,7 @@ func waitForWorkflowToBeCreated(t *testing.T, vc *VitessCluster, ksWorkflow stri
359
358
// additional stream sub-state such as "message==for vdiff".
360
359
// Invalid checks are ignored.
361
360
func waitForWorkflowState (t * testing.T , vc * VitessCluster , ksWorkflow string , wantState string , fieldEqualityChecks ... string ) {
362
- keyspace , workflow , ok := strings .Cut (ksWorkflow , "." )
363
- require .True (t , ok , "invalid <keyspace>.<workflow> value: %s" , ksWorkflow )
361
+ keyspace , workflow := parseKeyspaceWorkflow (t , ksWorkflow )
364
362
done := false
365
363
timer := time .NewTimer (workflowStateTimeout )
366
364
log .Infof ("Waiting for workflow %q to fully reach %q state" , ksWorkflow , wantState )
@@ -1053,3 +1051,10 @@ func validateOverrides(t *testing.T, tabs map[string]*cluster.VttabletProcess, w
1053
1051
}
1054
1052
}
1055
1053
}
1054
+
1055
+ func parseKeyspaceWorkflow (t * testing.T , ksWorkflow string ) (string , string ) {
1056
+ t .Helper ()
1057
+ keyspace , workflow , ok := strings .Cut (ksWorkflow , "." )
1058
+ require .True (t , ok , "invalid <keyspace>.<workflow> value: %s" , ksWorkflow )
1059
+ return keyspace , workflow
1060
+ }
0 commit comments