From e5648e8c7c8ef178ad34188aec4492d11796bf51 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Thu, 22 Feb 2018 15:01:48 +0200 Subject: [PATCH] Fix flaky test --- commands_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands_test.go b/commands_test.go index b173e0d4..5750bdea 100644 --- a/commands_test.go +++ b/commands_test.go @@ -62,12 +62,14 @@ var _ = Describe("Commands", func() { }) It("should Wait", func() { + const wait = 3 * time.Second + // assume testing on single redis instance start := time.Now() - wait := client.Wait(1, time.Second) - Expect(wait.Err()).NotTo(HaveOccurred()) - Expect(wait.Val()).To(Equal(int64(0))) - Expect(time.Now()).To(BeTemporally("~", start.Add(time.Second), 800*time.Millisecond)) + val, err := client.Wait(1, wait).Result() + Expect(err).NotTo(HaveOccurred()) + Expect(val).To(Equal(int64(0))) + Expect(time.Now()).To(BeTemporally("~", start.Add(wait), time.Second)) }) It("should Select", func() {