File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,24 @@ var _ = Describe("Sentinel PROTO 2", func() {
32
32
})
33
33
})
34
34
35
+ var _ = Describe ("Sentinel resolution" , func () {
36
+ It ("should resolve master without context exhaustion" , func () {
37
+ shortCtx , cancel := context .WithTimeout (ctx , 500 * time .Millisecond )
38
+ defer cancel ()
39
+
40
+ client := redis .NewFailoverClient (& redis.FailoverOptions {
41
+ MasterName : sentinelName ,
42
+ SentinelAddrs : sentinelAddrs ,
43
+ MaxRetries : - 1 ,
44
+ })
45
+
46
+ err := client .Ping (shortCtx ).Err ()
47
+ Expect (err ).NotTo (HaveOccurred (), "expected master to resolve without context exhaustion" )
48
+
49
+ _ = client .Close ()
50
+ })
51
+ })
52
+
35
53
var _ = Describe ("Sentinel" , func () {
36
54
var client * redis.Client
37
55
var master * redis.Client
You can’t perform that action at this time.
0 commit comments