mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
fix: Ring.Pipelined return dial timeout error (#3403)
* [ISSUE-3402]: Ring.Pipelined return dial timeout error * review fixes --------- Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
This commit is contained in:
15
ring_test.go
15
ring_test.go
@ -277,6 +277,21 @@ var _ = Describe("Redis Ring", func() {
|
||||
Expect(ringShard1.Info(ctx).Val()).ToNot(ContainSubstring("keys="))
|
||||
Expect(ringShard2.Info(ctx).Val()).To(ContainSubstring("keys=100"))
|
||||
})
|
||||
|
||||
It("return dial timeout error", func() {
|
||||
opt := redisRingOptions()
|
||||
opt.DialTimeout = 250 * time.Millisecond
|
||||
opt.Addrs = map[string]string{"ringShardNotExist": ":1997"}
|
||||
ring = redis.NewRing(opt)
|
||||
|
||||
_, err := ring.Pipelined(ctx, func(pipe redis.Pipeliner) error {
|
||||
pipe.HSet(ctx, "key", "value")
|
||||
pipe.Expire(ctx, "key", time.Minute)
|
||||
return nil
|
||||
})
|
||||
|
||||
Expect(err).To(HaveOccurred())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("new client callback", func() {
|
||||
|
Reference in New Issue
Block a user