Skip to content

Commit

Permalink
[OnlineDDL] add label so break works as intended (#13691)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Mason <[email protected]>
  • Loading branch information
Andrew Mason authored Aug 3, 2023
1 parent acd2615 commit 9cee9aa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func checkTablesCount(t *testing.T, tablet *cluster.Vttablet, showTableName stri
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
rowcount := 0

for {
queryResult, err := tablet.VttabletProcess.QueryTablet(query, keyspaceName, true)
require.Nil(t, err)
Expand All @@ -382,10 +383,14 @@ func checkTablesCount(t *testing.T, tablet *cluster.Vttablet, showTableName stri

select {
case <-time.After(time.Second):
continue // Keep looping
case <-ctx.Done():
break
// Break below to the assertion
}

break
}

assert.Equal(t, expectCount, rowcount)
}

Expand Down

0 comments on commit 9cee9aa

Please sign in to comment.