mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
Fix flaky test
This commit is contained in:
@ -62,12 +62,14 @@ var _ = Describe("Commands", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("should Wait", func() {
|
It("should Wait", func() {
|
||||||
|
const wait = 3 * time.Second
|
||||||
|
|
||||||
// assume testing on single redis instance
|
// assume testing on single redis instance
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
wait := client.Wait(1, time.Second)
|
val, err := client.Wait(1, wait).Result()
|
||||||
Expect(wait.Err()).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(wait.Val()).To(Equal(int64(0)))
|
Expect(val).To(Equal(int64(0)))
|
||||||
Expect(time.Now()).To(BeTemporally("~", start.Add(time.Second), 800*time.Millisecond))
|
Expect(time.Now()).To(BeTemporally("~", start.Add(wait), time.Second))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should Select", func() {
|
It("should Select", func() {
|
||||||
|
Reference in New Issue
Block a user