Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
make fmt and address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 committed Sep 9, 2021
1 parent 73cf942 commit 218f515
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions syncer/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ = Suite(&statusSuite{})

type statusSuite struct{}

func (t *statusSuite) TestStatueRace(c *C) {
func (t *statusSuite) TestStatusRace(c *C) {
s := &Syncer{}

l := log.With(zap.String("unit test", "TestStatueRace"))
Expand All @@ -32,7 +32,7 @@ func (t *statusSuite) TestStatueRace(c *C) {
Location: binlog.Location{
Position: mysql.Position{
Name: "mysql-bin.000123",
Pos: 223,
Pos: 223,
},
},
Binlogs: binlog.FileSizes(nil),
Expand All @@ -42,12 +42,14 @@ func (t *statusSuite) TestStatueRace(c *C) {
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
defer wg.Done()
ret := s.Status(sourceStatus)
status := ret.(*pb.SyncStatus)
c.Assert(status.MasterBinlog, Equals, "(mysql-bin.000123, 223)")
c.Assert(status.SyncerBinlog, Equals, "(mysql-bin.000123, 123)")
}()
}
wg.Wait()
}

type mockCheckpoint struct {
Expand All @@ -58,7 +60,7 @@ func (*mockCheckpoint) FlushedGlobalPoint() binlog.Location {
return binlog.Location{
Position: mysql.Position{
Name: "mysql-bin.000123",
Pos: 123,
Pos: 123,
},
}
}
}
2 changes: 1 addition & 1 deletion syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ type Syncer struct {

closed atomic.Bool

start atomic.Time
start atomic.Time
lastTime atomic.Time

// safeMode is used to track if we need to generate dml with safe-mode
Expand Down

0 comments on commit 218f515

Please sign in to comment.