Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions go/test/endtoend/vreplication/vdiff2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,22 @@ func testStop(t *testing.T, ksWorkflow, cells string) {
t.Run("Stop", func(t *testing.T) {
// Create a new VDiff and immediately stop it.
uuid, _ := performVDiff2Action(t, ksWorkflow, cells, "create", "", false)

// Ensure the state to be either completed or started
isStartedOrCompleted := false
maxRetries := 5
for i := 1; i <= maxRetries; i++ {
_, output := performVDiff2Action(t, ksWorkflow, cells, "show", uuid, false)
jsonOutput := getVDiffInfo(output)
isStartedOrCompleted = jsonOutput.State == "started" || jsonOutput.State == "completed"
if isStartedOrCompleted || i == maxRetries {
break
}
t.Logf("VDiff state expected to be started or completed, got: %s, retrying (attempt %d of %d)", jsonOutput.State, i, maxRetries)
time.Sleep(vdiffRetryInterval)
}
require.True(t, isStartedOrCompleted, "VDiff state should either be started or completed")

_, _ = performVDiff2Action(t, ksWorkflow, cells, "stop", uuid, false)
// Confirm the VDiff is in the expected state.
_, output := performVDiff2Action(t, ksWorkflow, cells, "show", uuid, false)
Expand Down
Loading