@@ -147,8 +147,7 @@ func TestPushNotifications(t *testing.T) {
147
147
failoverResp , err := faultInjector .TriggerAction (ctx , ActionRequest {
148
148
Type : "failover" ,
149
149
Parameters : map [string ]interface {}{
150
- "cluster_index" : "0" ,
151
- "bdb_id" : endpointConfig .BdbID ,
150
+ "bdb_id" : endpointConfig .BdbID ,
152
151
},
153
152
})
154
153
if err != nil {
@@ -199,7 +198,7 @@ func TestPushNotifications(t *testing.T) {
199
198
migrateResp , err := faultInjector .TriggerAction (ctx , ActionRequest {
200
199
Type : "migrate" ,
201
200
Parameters : map [string ]interface {}{
202
- "cluster_index " : "0" ,
201
+ "bdb_id " : endpointConfig . BdbID ,
203
202
},
204
203
})
205
204
if err != nil {
@@ -251,8 +250,7 @@ func TestPushNotifications(t *testing.T) {
251
250
bindResp , err := faultInjector .TriggerAction (ctx , ActionRequest {
252
251
Type : "bind" ,
253
252
Parameters : map [string ]interface {}{
254
- "cluster_index" : "0" ,
255
- "bdb_id" : endpointConfig .BdbID ,
253
+ "bdb_id" : endpointConfig .BdbID ,
256
254
},
257
255
})
258
256
if err != nil {
@@ -297,7 +295,7 @@ func TestPushNotifications(t *testing.T) {
297
295
}
298
296
}()
299
297
300
- p ("Waiting for MOVING notification on second client" )
298
+ p ("Waiting for MOVING notification on first client" )
301
299
match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
302
300
return strings .Contains (s , logs2 .ProcessingNotificationMessage ) && notificationType (s , "MOVING" )
303
301
}, 3 * time .Minute )
@@ -314,6 +312,7 @@ func TestPushNotifications(t *testing.T) {
314
312
// wait for moving on second client
315
313
// we know the maxconn is 15, assuming 16/17 was used to init the second client, so connID 18 should be from the second client
316
314
// also validate big enough relaxed timeout
315
+ p ("Waiting for MOVING notification on second client" )
317
316
match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
318
317
return strings .Contains (s , logs2 .ProcessingNotificationMessage ) && notificationType (s , "MOVING" ) && connID (s , 18 )
319
318
}, 3 * time .Minute )
@@ -372,27 +371,21 @@ func TestPushNotifications(t *testing.T) {
372
371
p ("Third client created" )
373
372
go commandsRunner3 .FireCommandsUntilStop (ctx )
374
373
// wait for moving on third client
375
- match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
376
- return strings .Contains (s , logs2 .ProcessingNotificationMessage ) && notificationType (s , "MOVING" ) && connID (s , 19 )
377
- }, 3 * time .Minute )
374
+ movingNotification , found := tracker .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
378
375
if ! found {
379
376
p ("[NOTICE] MOVING notification was not received within 3 minutes ON A THIRD CLIENT" )
380
377
} else {
381
- data := logs2 .ExtractDataFromLogMessage (match )
382
378
p ("MOVING notification received on third client. %v" , data )
383
- mNotif := data ["notification" ].(string )
384
- // format MOVING <seqID> <timeS> endpoint
385
- mNotifParts := strings .Split (mNotif , " " )
386
- if len (mNotifParts ) != 4 {
387
- ef ("Invalid MOVING notification format: %s" , mNotif )
379
+ if len (movingNotification ) != 4 {
380
+ p ("[NOTICE] Invalid MOVING notification format: %s" , mNotif )
388
381
}
389
- mNotifTimeS , err := strconv .Atoi (mNotifParts [2 ])
382
+ mNotifTimeS , err := strconv .Atoi (movingNotification [2 ].( string ) )
390
383
if err != nil {
391
- ef ( " Invalid timeS in MOVING notification: %s" , mNotif )
384
+ p ( "[NOTICE] Invalid timeS in MOVING notification: %s" , movingNotification )
392
385
}
393
386
// expect timeS to be less than 15
394
387
if mNotifTimeS < 15 {
395
- ef ( " Expected timeS < 15, got %d" , mNotifTimeS )
388
+ p ( "[NOTICE] Expected timeS < 15, got %d" , mNotifTimeS )
396
389
}
397
390
}
398
391
commandsRunner3 .Stop ()
0 commit comments