Skip to content

Commit

Permalink
Fix the test
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Aug 27, 2021
1 parent a443374 commit 337f78d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/errs/errs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func (s *testErrorSuite) TestError(c *C) {
lg := newZapTestLogger(conf)
log.ReplaceGlobals(lg.Logger, nil)

rfc := `[error="[PD:tso:ErrInvalidTimestamp]invalid timestamp"]`
rfc := `[error="[PD:member:ErrEtcdLeaderNotFound]etcd leader not found`
log.Error("test", zap.Error(ErrEtcdLeaderNotFound.FastGenByArgs()))
c.Assert(strings.Contains(lg.Message(), rfc), IsTrue)
err := errors.New("test error")
log.Error("test", ZapError(ErrEtcdLeaderNotFound, err))
rfc = `[error="[PD:tso:ErrInvalidTimestamp]test error"]`
rfc = `[error="[PD:member:ErrEtcdLeaderNotFound]test error"]`
c.Assert(strings.Contains(lg.Message(), rfc), IsTrue)
}

Expand Down

0 comments on commit 337f78d

Please sign in to comment.