@@ -166,7 +166,7 @@ func TestPushNotifications(t *testing.T) {
166
166
if err != nil {
167
167
ef ("[FI] Failover action failed: %v" , err )
168
168
}
169
- p ("[FI] Failover action completed: %+v" , status )
169
+ p ("[FI] Failover action completed: %+v" , status . Status )
170
170
171
171
p ("FAILING_OVER / FAILED_OVER notifications test completed successfully" )
172
172
@@ -203,7 +203,7 @@ func TestPushNotifications(t *testing.T) {
203
203
if err != nil {
204
204
ef ("[FI] Migrate action failed: %v" , err )
205
205
}
206
- p ("[FI] Migrate action completed: %+v" , status )
206
+ p ("[FI] Migrate action completed: %+v" , status . Status )
207
207
208
208
go func () {
209
209
p ("Waiting for MIGRATED notification on conn %d with seqID %d..." , connIDToObserve , seqIDToObserve + 1 )
@@ -266,6 +266,9 @@ func TestPushNotifications(t *testing.T) {
266
266
errChan := make (chan error , 1 )
267
267
268
268
go func () {
269
+ var match string
270
+ var matchNotif []interface {}
271
+ var found bool
269
272
defer func () {
270
273
if r := recover (); r != nil {
271
274
errChan <- fmt .Errorf ("goroutine panic: %v" , r )
@@ -290,15 +293,14 @@ func TestPushNotifications(t *testing.T) {
290
293
// 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
291
294
// also validate big enough relaxed timeout
292
295
p ("Waiting for MOVING notification on second client" )
293
- match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
294
- return strings .Contains (s , logs2 .ProcessingNotificationMessage ) && notificationType (s , "MOVING" ) && connID (s , 18 )
295
- }, 3 * time .Minute )
296
+ matchNotif , found = tracker2 .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
296
297
if ! found {
297
298
errChan <- fmt .Errorf ("MOVING notification was not received within 3 minutes ON A SECOND CLIENT" )
298
299
return
299
300
} else {
300
- p ("MOVING notification received on second client %v" , logs2 . ExtractDataFromLogMessage ( match ) )
301
+ p ("MOVING notification received on second client %v" , matchNotif )
301
302
}
303
+
302
304
// wait for relaxation of 30m
303
305
match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
304
306
return strings .Contains (s , logs2 .ApplyingRelaxedTimeoutDueToPostHandoffMessage ) && strings .Contains (s , "30m" )
@@ -319,6 +321,7 @@ func TestPushNotifications(t *testing.T) {
319
321
seqIDToObserve = int64 (movingData ["seqID" ].(float64 ))
320
322
connIDToObserve = uint64 (movingData ["connID" ].(float64 ))
321
323
324
+ time .Sleep (3 * time .Second )
322
325
// start a third client but don't execute any commands on it
323
326
p ("Starting a third client to observe notification during moving..." )
324
327
client3 , err := factory .Create ("push-notification-client-2" , & CreateClientOptions {
@@ -348,7 +351,7 @@ func TestPushNotifications(t *testing.T) {
348
351
p ("Third client created" )
349
352
go commandsRunner3 .FireCommandsUntilStop (ctx )
350
353
// wait for moving on third client
351
- movingNotification , found := tracker .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
354
+ movingNotification , found := tracker3 .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
352
355
if ! found {
353
356
p ("[NOTICE] MOVING notification was not received within 3 minutes ON A THIRD CLIENT" )
354
357
} else {
@@ -379,7 +382,7 @@ func TestPushNotifications(t *testing.T) {
379
382
ef ("Bind action failed: %v" , err )
380
383
}
381
384
382
- p ("Bind action completed: %+v" , bindStatus )
385
+ p ("Bind action completed: %+v" , bindStatus . Status )
383
386
384
387
p ("MOVING notification test completed successfully" )
385
388
0 commit comments