9
9
"github.com/redis/go-redis/v9"
10
10
)
11
11
12
- var _ = Describe ("Sentinel" , func () {
12
+ var _ = FDescribe ("Sentinel" , func () {
13
13
var _ = Describe ("Sentinel PROTO 2" , func () {
14
14
var client * redis.Client
15
15
BeforeEach (func () {
@@ -63,13 +63,13 @@ var _ = Describe("Sentinel", func() {
63
63
// Wait until slaves are picked up by sentinel.
64
64
Eventually (func () string {
65
65
return sentinel1 .Info (ctx ).Val ()
66
- }, "15s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
66
+ }, "30s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
67
67
Eventually (func () string {
68
68
return sentinel2 .Info (ctx ).Val ()
69
- }, "15s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
69
+ }, "30s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
70
70
Eventually (func () string {
71
71
return sentinel3 .Info (ctx ).Val ()
72
- }, "15s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
72
+ }, "30s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
73
73
})
74
74
75
75
AfterEach (func () {
@@ -93,7 +93,7 @@ var _ = Describe("Sentinel", func() {
93
93
Eventually (func () []string {
94
94
slavesAddr = redis .GetSlavesAddrByName (ctx , sentinel , sentinelName )
95
95
return slavesAddr
96
- }, "15s " , "100ms" ).Should (HaveLen (2 ))
96
+ }, "30s " , "100ms" ).Should (HaveLen (2 ))
97
97
Eventually (func () bool {
98
98
sync := true
99
99
for _ , addr := range slavesAddr {
@@ -105,7 +105,7 @@ var _ = Describe("Sentinel", func() {
105
105
_ = slave .Close ()
106
106
}
107
107
return sync
108
- }, "15s " , "100ms" ).Should (BeTrue ())
108
+ }, "30s " , "100ms" ).Should (BeTrue ())
109
109
110
110
// Create subscription.
111
111
pub := client .Subscribe (ctx , "foo" )
@@ -116,19 +116,19 @@ var _ = Describe("Sentinel", func() {
116
116
Expect (err ).NotTo (HaveOccurred ())
117
117
Eventually (func () error {
118
118
return master .Ping (ctx ).Err ()
119
- }, "15s " , "100ms" ).Should (HaveOccurred ())
119
+ }, "30s " , "100ms" ).Should (HaveOccurred ())
120
120
121
121
// Check that client picked up new master.
122
122
Eventually (func () string {
123
123
return client .Get (ctx , "foo" ).Val ()
124
- }, "15s " , "100ms" ).Should (Equal ("master" ))
124
+ }, "30s " , "100ms" ).Should (Equal ("master" ))
125
125
126
126
// Check if subscription is renewed.
127
127
var msg * redis.Message
128
128
Eventually (func () <- chan * redis.Message {
129
129
_ = client .Publish (ctx , "foo" , "hello" ).Err ()
130
130
return ch
131
- }, "15s " , "100ms" ).Should (Receive (& msg ))
131
+ }, "30s " , "100ms" ).Should (Receive (& msg ))
132
132
Expect (msg .Channel ).To (Equal ("foo" ))
133
133
Expect (msg .Payload ).To (Equal ("hello" ))
134
134
Expect (pub .Close ()).NotTo (HaveOccurred ())
@@ -218,13 +218,13 @@ var _ = Describe("Sentinel", func() {
218
218
// Wait until slaves are picked up by sentinel.
219
219
Eventually (func () string {
220
220
return sentinel1 .Info (ctx ).Val ()
221
- }, "15s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
221
+ }, "30s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
222
222
Eventually (func () string {
223
223
return sentinel2 .Info (ctx ).Val ()
224
- }, "15s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
224
+ }, "30s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
225
225
Eventually (func () string {
226
226
return sentinel3 .Info (ctx ).Val ()
227
- }, "15s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
227
+ }, "30s " , "100ms" ).Should (ContainSubstring ("slaves=2" ))
228
228
})
229
229
230
230
AfterEach (func () {
@@ -241,7 +241,7 @@ var _ = Describe("Sentinel", func() {
241
241
// Verify.
242
242
Eventually (func () string {
243
243
return client .Get (ctx , "foo" ).Val ()
244
- }, "15s " , "1ms" ).Should (Equal ("master" ))
244
+ }, "30s " , "1ms" ).Should (Equal ("master" ))
245
245
}
246
246
247
247
// Create subscription.
@@ -253,19 +253,19 @@ var _ = Describe("Sentinel", func() {
253
253
Expect (err ).NotTo (HaveOccurred ())
254
254
Eventually (func () error {
255
255
return master .Ping (ctx ).Err ()
256
- }, "15s " , "100ms" ).Should (HaveOccurred ())
256
+ }, "30s " , "100ms" ).Should (HaveOccurred ())
257
257
258
258
// Check that client picked up new master.
259
259
Eventually (func () string {
260
260
return client .Get (ctx , "foo" ).Val ()
261
- }, "15s " , "100ms" ).Should (Equal ("master" ))
261
+ }, "30s " , "100ms" ).Should (Equal ("master" ))
262
262
263
263
// Check if subscription is renewed.
264
264
var msg * redis.Message
265
265
Eventually (func () <- chan * redis.Message {
266
266
_ = client .Publish (ctx , "foo" , "hello" ).Err ()
267
267
return ch
268
- }, "15s " , "100ms" ).Should (Receive (& msg ))
268
+ }, "30s " , "100ms" ).Should (Receive (& msg ))
269
269
Expect (msg .Channel ).To (Equal ("foo" ))
270
270
Expect (msg .Payload ).To (Equal ("hello" ))
271
271
Expect (sub .Close ()).NotTo (HaveOccurred ())
@@ -343,7 +343,7 @@ var _ = Describe("Sentinel", func() {
343
343
for _ , process := range sentinels () {
344
344
Eventually (func () string {
345
345
return process .Info (ctx ).Val ()
346
- }, "15s " , "100ms" ).Should (ContainSubstring ("sentinels=3" ))
346
+ }, "30s " , "100ms" ).Should (ContainSubstring ("sentinels=3" ))
347
347
}
348
348
})
349
349
0 commit comments