File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ var _ = Describe("pool", func() {
17
17
opt := redisOptions ()
18
18
opt .MinIdleConns = 0
19
19
opt .MaxConnAge = 0
20
- opt .IdleTimeout = 2 * time .Second
20
+ opt .IdleTimeout = time .Second
21
21
client = redis .NewClient (opt )
22
22
})
23
23
@@ -105,6 +105,13 @@ var _ = Describe("pool", func() {
105
105
})
106
106
107
107
It ("reuses connections" , func () {
108
+ // explain: https://github.com/go-redis/redis/pull/1675
109
+ opt := redisOptions ()
110
+ opt .MinIdleConns = 0
111
+ opt .MaxConnAge = 0
112
+ opt .IdleTimeout = 2 * time .Second
113
+ client = redis .NewClient (opt )
114
+
108
115
for i := 0 ; i < 100 ; i ++ {
109
116
val , err := client .Ping (ctx ).Result ()
110
117
Expect (err ).NotTo (HaveOccurred ())
@@ -135,7 +142,7 @@ var _ = Describe("pool", func() {
135
142
StaleConns : 0 ,
136
143
}))
137
144
138
- time .Sleep (3 * time .Second )
145
+ time .Sleep (2 * time .Second )
139
146
140
147
stats = client .PoolStats ()
141
148
Expect (stats ).To (Equal (& redis.PoolStats {
You can’t perform that action at this time.
0 commit comments