@@ -77,18 +77,23 @@ var _ = Describe("Client", func() {
77
77
})
78
78
79
79
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 ())
82
85
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
+ })
85
90
86
- //err = client.Ping(ctx).Err()
87
- //Expect(err).NotTo(HaveOccurred())
91
+ It ("timeout should support dialHook" , func () {
88
92
89
- //check withTimeout supports the addition of dialHook
90
93
var res []string
91
94
res = append (res , "before" )
95
+
96
+ client .WithTimeout (10 * time .Millisecond )
92
97
client .AddHook (& hook {
93
98
dialHook : func (hook redis.DialHook ) redis.DialHook {
94
99
res = append (res , "before-dial-hook-start" )
@@ -99,8 +104,8 @@ var _ = Describe("Client", func() {
99
104
}
100
105
},
101
106
})
102
- client .Keys (ctx , "key" )
103
- // Expect(err).NotTo(HaveOccurred())
107
+ err := client .Ping (ctx ). Err ( )
108
+ Expect (err ).NotTo (HaveOccurred ())
104
109
Expect (res ).To (Equal ([]string {
105
110
"dial-hook-start" ,
106
111
}))
0 commit comments