Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesCheung96 committed May 18, 2022
1 parent 5c54e1a commit 0078166
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cdc/sink/mq/mq_flush_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func TestBatch(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
// Can not be parallel, it tests reusing the same batch.

wg.Add(1)
go func() {
defer wg.Done()
Expand All @@ -192,10 +191,11 @@ func TestBatch(t *testing.T) {
go func() {
for _, event := range test.events {
err := worker.addEvent(ctx, event)
if event.row == nil || event.row.CommitTs != math.MaxUint64 {
require.NoError(t, err)
} else {
if event.row != nil && event.row.CommitTs == math.MaxUint64 {
// For unprocessed events, addEvent returns after ctx has been cancelled.
require.Regexp(t, ".*context canceled.*", err)
} else {
require.NoError(t, err)
}
}
}()
Expand Down

0 comments on commit 0078166

Please sign in to comment.