mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Fix nil pool on read timeout. Fixes #135.
This commit is contained in:
@ -134,6 +134,20 @@ var _ = Describe("Client", func() {
|
||||
Expect(db1.FlushDb().Err()).NotTo(HaveOccurred())
|
||||
})
|
||||
|
||||
It("should support DB selection with read timeout (issue #135)", func() {
|
||||
for i := 0; i < 100; i++ {
|
||||
db1 := redis.NewClient(&redis.Options{
|
||||
Addr: redisAddr,
|
||||
DB: 1,
|
||||
ReadTimeout: time.Nanosecond,
|
||||
})
|
||||
|
||||
err := db1.Ping().Err()
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(err.(net.Error).Timeout()).To(BeTrue())
|
||||
}
|
||||
})
|
||||
|
||||
It("should retry command on network error", func() {
|
||||
Expect(client.Close()).NotTo(HaveOccurred())
|
||||
|
||||
|
Reference in New Issue
Block a user