mirror of
https://github.com/redis/go-redis.git
synced 2025-07-26 19:21:03 +03:00
Fix flaky tests by using better matcher.
This commit is contained in:
@ -369,8 +369,7 @@ var _ = Describe("Commands", func() {
|
||||
|
||||
pttl := client.PTTL("key")
|
||||
Expect(pttl.Err()).NotTo(HaveOccurred())
|
||||
Expect(pttl.Val() <= expiration).To(Equal(true))
|
||||
Expect(pttl.Val() >= expiration-time.Millisecond).To(Equal(true))
|
||||
Expect(pttl.Val()).To(BeNumerically("~", expiration, 10*time.Millisecond))
|
||||
})
|
||||
|
||||
It("should PExpireAt", func() {
|
||||
@ -389,8 +388,7 @@ var _ = Describe("Commands", func() {
|
||||
|
||||
pttl := client.PTTL("key")
|
||||
Expect(pttl.Err()).NotTo(HaveOccurred())
|
||||
Expect(pttl.Val() <= expiration).To(Equal(true))
|
||||
Expect(pttl.Val() >= expiration-time.Millisecond).To(Equal(true))
|
||||
Expect(pttl.Val()).To(BeNumerically("~", expiration, 10*time.Millisecond))
|
||||
})
|
||||
|
||||
It("should PTTL", func() {
|
||||
@ -405,8 +403,7 @@ var _ = Describe("Commands", func() {
|
||||
|
||||
pttl := client.PTTL("key")
|
||||
Expect(pttl.Err()).NotTo(HaveOccurred())
|
||||
Expect(pttl.Val() <= expiration).To(Equal(true))
|
||||
Expect(pttl.Val() >= expiration-time.Millisecond).To(Equal(true))
|
||||
Expect(pttl.Val()).To(BeNumerically("~", expiration, 10*time.Millisecond))
|
||||
})
|
||||
|
||||
It("should RandomKey", func() {
|
||||
|
Reference in New Issue
Block a user