Skip to content

Commit

Permalink
Fix waitForWorkflowToBeCreated
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <mattalord@gmail.com>
  • Loading branch information
mattlord committed Dec 28, 2024
1 parent dd72a3c commit 85c87ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions go/test/endtoend/vreplication/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func waitForWorkflowToBeCreated(t *testing.T, vc *VitessCluster, ksWorkflow stri
keyspace, workflow := parseKeyspaceWorkflow(t, ksWorkflow)
require.NoError(t, waitForCondition("workflow to be created", func() bool {
output, err := vc.VtctldClient.ExecuteCommandWithOutput("Workflow", "--keyspace", keyspace, "show", "--workflow", workflow, "--compact", "--include-logs=false")
return err == nil && isEmptyWorkflowShowOutput(output)
return err == nil && !isEmptyWorkflowShowOutput(output)
}, defaultTimeout))
}

Expand Down Expand Up @@ -1082,9 +1082,8 @@ func isEmptyWorkflowShowOutput(output string) bool {
emptyJSON = `{}`
emptyNonCompactWorkflowShowResponse = `{
"workflows": []
}
`
}`
)

return output == emptyJSON || output == emptyNonCompactWorkflowShowResponse
return strings.TrimSpace(output) == emptyJSON || strings.TrimSpace(output) == emptyNonCompactWorkflowShowResponse
}

0 comments on commit 85c87ff

Please sign in to comment.