mirror of https://github.com/go-redis/redis.git
Merge pull request #1675 from monkey92t/test_error
fix unit test errors that may appear in pool_test.go
This commit is contained in:
commit
9b4cabeba3
|
@ -105,6 +105,13 @@ var _ = Describe("pool", func() {
|
||||||
})
|
})
|
||||||
|
|
||||||
It("reuses connections", func() {
|
It("reuses connections", func() {
|
||||||
|
// explain: https://github.com/go-redis/redis/pull/1675
|
||||||
|
opt := redisOptions()
|
||||||
|
opt.MinIdleConns = 0
|
||||||
|
opt.MaxConnAge = 0
|
||||||
|
opt.IdleTimeout = 2 * time.Second
|
||||||
|
client = redis.NewClient(opt)
|
||||||
|
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
val, err := client.Ping(ctx).Result()
|
val, err := client.Ping(ctx).Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
|
Loading…
Reference in New Issue