diff --git a/tests/utils.go b/tests/utils.go index 001d77e9..92163d5c 100644 --- a/tests/utils.go +++ b/tests/utils.go @@ -86,8 +86,8 @@ func AssertEqual(t *testing.T, got, expect interface{}) { if curTime, ok := got.(time.Time); ok { format := "2006-01-02T15:04:05Z07:00" - if curTime.Format(format) != expect.(time.Time).Format(format) { - t.Errorf("%v: expect: %v, got %v", utils.FileWithLineNum(), expect.(time.Time).Format(format), curTime.Format(format)) + if curTime.Round(time.Second).Format(format) != expect.(time.Time).Round(time.Second).Format(format) { + t.Errorf("%v: expect: %v, got %v", utils.FileWithLineNum(), expect.(time.Time).Round(time.Second).Format(format), curTime.Round(time.Second).Format(format)) } } else if got != expect { t.Errorf("%v: expect: %#v, got %#v", utils.FileWithLineNum(), expect, got)