From e7bdad3e690263702dd8d6fcebaeae54459b1abd Mon Sep 17 00:00:00 2001 From: chenbt Date: Fri, 15 Dec 2023 10:40:14 +0800 Subject: [PATCH] Fixed the slow log timestamp format is inconsistent with Redis (#2206) --- tests/integration/slowlog_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/slowlog_test.go b/tests/integration/slowlog_test.go index 3fcce4d1c3..fa6f96a7c9 100644 --- a/tests/integration/slowlog_test.go +++ b/tests/integration/slowlog_test.go @@ -81,7 +81,8 @@ var _ = Describe("Slowlog Commands", func() { Expect(err).NotTo(HaveOccurred()) for i := 0; i < 10; i++ { - Expect(isBetween(time1.UnixNano(), time2.UnixNano(), time.Unix(0, result[i].Time.Unix()*1e3).UnixNano())).To(Equal(true)) + Expect(result[i].Time.Unix()).To(BeNumerically("~", 0, 9999999999)) + Expect(isBetween(time1.Unix(), time2.Unix(), result[i].Time.Unix())).To(Equal(true)) } }) })