Skip to content

Commit

Permalink
Nitty test improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Mar 5, 2024
1 parent 51ed45a commit 3ed17b0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions go/test/endtoend/vreplication/vstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,10 @@ func TestMultiVStreamsKeyspaceReshard(t *testing.T) {
case "-80", "80-":
oldShardRowEvents++
case "0":
// We expect some for the sequence backing table, but don't care.
default:
require.FailNow(t, fmt.Sprintf("received event for unexpected shard: %s", shard))
}
case binlogdatapb.VEventType_JOURNAL:
require.FailNow(t, fmt.Sprintf("received unexpected journal event for keyspace: %s", ev.GetKeyspace()))
case binlogdatapb.VEventType_VGTID:
newVGTID = ev.GetVgtid()
if len(newVGTID.GetShardGtids()) == 3 {
Expand All @@ -642,7 +641,6 @@ func TestMultiVStreamsKeyspaceReshard(t *testing.T) {
}
default:
require.FailNow(t, fmt.Sprintf("VStream returned unexpected error: %v", err))
return
}
select {
case <-streamCtx.Done():
Expand Down Expand Up @@ -678,17 +676,14 @@ func TestMultiVStreamsKeyspaceReshard(t *testing.T) {
case "-40", "40-80", "80-c0", "c0-":
newShardRowEvents++
case "0":
// Again, we expect some for the sequence backing table, but don't care.
default:
require.FailNow(t, fmt.Sprintf("received event for unexpected shard: %s", shard))
}
}
}
case io.EOF:
log.Infof("Stream Ended")
streamCancel()
default:
log.Errorf("Returned err %v", err)
streamCancel()
require.FailNow(t, fmt.Sprintf("VStream returned unexpected error: %v", err))
}
select {
case <-done:
Expand Down

0 comments on commit 3ed17b0

Please sign in to comment.