diff --git a/commands.go b/commands.go index bc93df9..e2dc0ca 100644 --- a/commands.go +++ b/commands.go @@ -275,7 +275,7 @@ func (c *cmdable) Ping() *StatusCmd { func (c *cmdable) Wait(numSlaves int, timeout time.Duration) *IntCmd { - cmd := NewIntCmd("wait", numSlaves, int(timeout/time.Second)) + cmd := NewIntCmd("wait", numSlaves, int(timeout/time.Millisecond)) c.process(cmd) return cmd } diff --git a/commands_test.go b/commands_test.go index a524aaf..7e4182e 100644 --- a/commands_test.go +++ b/commands_test.go @@ -52,9 +52,11 @@ var _ = Describe("Commands", func() { It("should Wait", func() { // assume testing on single redis instance - wait := client.Wait(0, time.Minute) + 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)) }) It("should Select", func() {