Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei committed Apr 20, 2020
1 parent adfc83f commit 3358ec7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cdc/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ func (p *processor) addTable(ctx context.Context, tableID int64, startTs uint64)
case model.SortInFile:
sorter = puller.NewFileSorter(p.changefeed.SortDir)
default:
p.errCh <- errors.Errorf("unknown sort engine %d", p.changefeed.Engine)
p.errCh <- errors.Errorf("unknown sort engine %s", p.changefeed.Engine)
return
}

Expand Down
8 changes: 4 additions & 4 deletions cdc/puller/entry_sorter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (s *mockEntrySorterSuite) TestEntrySorter(c *check.C) {
for _, entry := range tc.input {
es.AddEntry(ctx, model.NewPolymorphicEvent(entry))
}
es.AddEntry(model.NewResolvedPolymorphicEvent(tc.resolvedTs))
es.AddEntry(ctx, model.NewResolvedPolymorphicEvent(tc.resolvedTs))
for i := 0; i < len(tc.expect); i++ {
e := <-es.Output()
c.Check(e.RawKV, check.DeepEquals, tc.expect[i])
Expand Down Expand Up @@ -134,11 +134,11 @@ func (s *mockEntrySorterSuite) TestEntrySorterRandomly(c *check.C) {
Ts: uint64(int64(resolvedTs) + rand.Int63n(int64(maxTs-resolvedTs))),
OpType: opType,
}
es.AddEntry(model.NewPolymorphicEvent(entry))
es.AddEntry(ctx, model.NewPolymorphicEvent(entry))
}
es.AddEntry(model.NewResolvedPolymorphicEvent(resolvedTs))
es.AddEntry(ctx, model.NewResolvedPolymorphicEvent(resolvedTs))
}
es.AddEntry(model.NewResolvedPolymorphicEvent(maxTs))
es.AddEntry(ctx, model.NewResolvedPolymorphicEvent(maxTs))
}()
var lastTs uint64
var resolvedTs uint64
Expand Down

0 comments on commit 3358ec7

Please sign in to comment.