fix unit test errors that may appear in pool_test.go

/redis/pool_test.go:119 Expected: <uint32>: 98 to equal: <uint32>: 99

Signed-off-by: monkey <golang@88.com>
This commit is contained in:
monkey 2021-02-25 17:41:44 +08:00
parent f4ae0ba02b
commit 42b2a72e66
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ var _ = Describe("pool", func() {
opt := redisOptions() opt := redisOptions()
opt.MinIdleConns = 0 opt.MinIdleConns = 0
opt.MaxConnAge = 0 opt.MaxConnAge = 0
opt.IdleTimeout = time.Second opt.IdleTimeout = 2 * time.Second
client = redis.NewClient(opt) client = redis.NewClient(opt)
}) })
@ -135,7 +135,7 @@ var _ = Describe("pool", func() {
StaleConns: 0, StaleConns: 0,
})) }))
time.Sleep(2 * time.Second) time.Sleep(3 * time.Second)
stats = client.PoolStats() stats = client.PoolStats()
Expect(stats).To(Equal(&redis.PoolStats{ Expect(stats).To(Equal(&redis.PoolStats{