@@ -166,7 +166,7 @@ func TestPushNotifications(t *testing.T) {
166166 if err != nil {
167167 ef ("[FI] Failover action failed: %v" , err )
168168 }
169- p ("[FI] Failover action completed: %+v" , status )
169+ p ("[FI] Failover action completed: %+v" , status . Status )
170170
171171 p ("FAILING_OVER / FAILED_OVER notifications test completed successfully" )
172172
@@ -203,7 +203,7 @@ func TestPushNotifications(t *testing.T) {
203203 if err != nil {
204204 ef ("[FI] Migrate action failed: %v" , err )
205205 }
206- p ("[FI] Migrate action completed: %+v" , status )
206+ p ("[FI] Migrate action completed: %+v" , status . Status )
207207
208208 go func () {
209209 p ("Waiting for MIGRATED notification on conn %d with seqID %d..." , connIDToObserve , seqIDToObserve + 1 )
@@ -266,6 +266,9 @@ func TestPushNotifications(t *testing.T) {
266266 errChan := make (chan error , 1 )
267267
268268 go func () {
269+ var match string
270+ var matchNotif []interface {}
271+ var found bool
269272 defer func () {
270273 if r := recover (); r != nil {
271274 errChan <- fmt .Errorf ("goroutine panic: %v" , r )
@@ -290,15 +293,14 @@ func TestPushNotifications(t *testing.T) {
290293 // 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
291294 // also validate big enough relaxed timeout
292295 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 )
296297 if ! found {
297298 errChan <- fmt .Errorf ("MOVING notification was not received within 3 minutes ON A SECOND CLIENT" )
298299 return
299300 } else {
300- p ("MOVING notification received on second client %v" , logs2 . ExtractDataFromLogMessage ( match ) )
301+ p ("MOVING notification received on second client %v" , matchNotif )
301302 }
303+
302304 // wait for relaxation of 30m
303305 match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
304306 return strings .Contains (s , logs2 .ApplyingRelaxedTimeoutDueToPostHandoffMessage ) && strings .Contains (s , "30m" )
@@ -319,6 +321,7 @@ func TestPushNotifications(t *testing.T) {
319321 seqIDToObserve = int64 (movingData ["seqID" ].(float64 ))
320322 connIDToObserve = uint64 (movingData ["connID" ].(float64 ))
321323
324+ time .Sleep (3 * time .Second )
322325 // start a third client but don't execute any commands on it
323326 p ("Starting a third client to observe notification during moving..." )
324327 client3 , err := factory .Create ("push-notification-client-2" , & CreateClientOptions {
@@ -348,7 +351,7 @@ func TestPushNotifications(t *testing.T) {
348351 p ("Third client created" )
349352 go commandsRunner3 .FireCommandsUntilStop (ctx )
350353 // wait for moving on third client
351- movingNotification , found := tracker .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
354+ movingNotification , found := tracker3 .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
352355 if ! found {
353356 p ("[NOTICE] MOVING notification was not received within 3 minutes ON A THIRD CLIENT" )
354357 } else {
@@ -379,7 +382,7 @@ func TestPushNotifications(t *testing.T) {
379382 ef ("Bind action failed: %v" , err )
380383 }
381384
382- p ("Bind action completed: %+v" , bindStatus )
385+ p ("Bind action completed: %+v" , bindStatus . Status )
383386
384387 p ("MOVING notification test completed successfully" )
385388
0 commit comments