@@ -77,18 +77,23 @@ var _ = Describe("Client", func() {
7777 })
7878
7979 It ("supports WithTimeout" , func () {
80- //err := client.ClientPause(ctx, time.Second).Err()
81- //Expect(err).NotTo(HaveOccurred())
80+ err := client .ClientPause (ctx , time .Second ).Err ()
81+ Expect (err ).NotTo (HaveOccurred ())
82+
83+ err = client .WithTimeout (10 * time .Millisecond ).Ping (ctx ).Err ()
84+ Expect (err ).To (HaveOccurred ())
8285
83- //err = client.WithTimeout(10 * time.Millisecond).Ping(ctx).Err()
84- //Expect(err).To(HaveOccurred())
86+ err = client .Ping (ctx ).Err ()
87+ Expect (err ).NotTo (HaveOccurred ())
88+
89+ })
8590
86- //err = client.Ping(ctx).Err()
87- //Expect(err).NotTo(HaveOccurred())
91+ It ("timeout should support dialHook" , func () {
8892
89- //check withTimeout supports the addition of dialHook
9093 var res []string
9194 res = append (res , "before" )
95+
96+ client .WithTimeout (10 * time .Millisecond )
9297 client .AddHook (& hook {
9398 dialHook : func (hook redis.DialHook ) redis.DialHook {
9499 res = append (res , "before-dial-hook-start" )
@@ -99,8 +104,8 @@ var _ = Describe("Client", func() {
99104 }
100105 },
101106 })
102- client .Keys (ctx , "key" )
103- // Expect(err).NotTo(HaveOccurred())
107+ err := client .Ping (ctx ). Err ( )
108+ Expect (err ).NotTo (HaveOccurred ())
104109 Expect (res ).To (Equal ([]string {
105110 "dial-hook-start" ,
106111 }))
0 commit comments