mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
fix: improve pipelines retry logic (#2232)
* fix: improve pipelines retry logic
This commit is contained in:
committed by
GitHub
parent
6327c52e60
commit
dd9a200427
21
race_test.go
21
race_test.go
@ -2,7 +2,6 @@ package redis_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
@ -289,26 +288,6 @@ var _ = Describe("races", func() {
|
||||
wg.Wait()
|
||||
Expect(atomic.LoadUint32(&received)).To(Equal(uint32(C * N)))
|
||||
})
|
||||
|
||||
It("should abort on context timeout", func() {
|
||||
opt := redisClusterOptions()
|
||||
client := cluster.newClusterClient(ctx, opt)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
wg := performAsync(C, func(_ int) {
|
||||
_, err := client.XRead(ctx, &redis.XReadArgs{
|
||||
Streams: []string{"test", "$"},
|
||||
Block: 1 * time.Second,
|
||||
}).Result()
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(err.Error()).To(Or(Equal(context.Canceled.Error()), ContainSubstring("operation was canceled")))
|
||||
})
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
cancel()
|
||||
wg.Wait()
|
||||
})
|
||||
})
|
||||
|
||||
var _ = Describe("cluster races", func() {
|
||||
|
Reference in New Issue
Block a user