mirror of
https://github.com/redis/go-redis.git
synced 2025-07-18 00:20:57 +03:00
This reverts commit 346bfafddd
.
This commit is contained in:
@ -123,7 +123,7 @@ var _ = Describe("Tx", func() {
|
||||
Expect(num).To(Equal(int64(N)))
|
||||
})
|
||||
|
||||
It("should remove from bad connection", func() {
|
||||
It("should recover from bad connection", func() {
|
||||
// Put bad connection in the pool.
|
||||
cn, err := client.Pool().Get(context.Background())
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
@ -134,14 +134,17 @@ var _ = Describe("Tx", func() {
|
||||
do := func() error {
|
||||
err := client.Watch(ctx, func(tx *redis.Tx) error {
|
||||
_, err := tx.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
|
||||
return pipe.Ping(ctx).Err()
|
||||
pipe.Ping(ctx)
|
||||
return nil
|
||||
})
|
||||
return err
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// connCheck will automatically remove damaged connections.
|
||||
err = do()
|
||||
Expect(err).To(MatchError("bad connection"))
|
||||
|
||||
err = do()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
|
Reference in New Issue
Block a user