@@ -266,9 +266,6 @@ 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
272
269
defer func () {
273
270
if r := recover (); r != nil {
274
271
errChan <- fmt .Errorf ("goroutine panic: %v" , r )
@@ -280,6 +277,11 @@ func TestPushNotifications(t *testing.T) {
280
277
return strings .Contains (s , logs2 .ProcessingNotificationMessage ) && notificationType (s , "MOVING" )
281
278
}, 3 * time .Minute )
282
279
commandsRunner .Stop ()
280
+ if ! found {
281
+ errChan <- fmt .Errorf ("MOVING notification was not received within 3 minutes ON A FIRST CLIENT" )
282
+ return
283
+ }
284
+
283
285
// once moving is received, start a second client commands runner
284
286
p ("Starting commands on second client" )
285
287
go commandsRunner2 .FireCommandsUntilStop (ctx )
@@ -289,33 +291,26 @@ func TestPushNotifications(t *testing.T) {
289
291
// destroy the second client
290
292
factory .Destroy ("push-notification-client-2" )
291
293
}()
292
- // wait for moving on second client
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
294
- // also validate big enough relaxed timeout
294
+
295
295
p ("Waiting for MOVING notification on second client" )
296
- matchNotif , found = tracker2 .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
297
- if ! found {
296
+ matchNotif , fnd : = tracker2 .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
297
+ if ! fnd {
298
298
errChan <- fmt .Errorf ("MOVING notification was not received within 3 minutes ON A SECOND CLIENT" )
299
299
return
300
300
} else {
301
301
p ("MOVING notification received on second client %v" , matchNotif )
302
302
}
303
303
304
- // wait for relaxation of 30m
305
- match , found = logCollector .MatchOrWaitForLogMatchFunc (func (s string ) bool {
306
- return strings .Contains (s , logs2 .ApplyingRelaxedTimeoutDueToPostHandoffMessage ) && strings .Contains (s , "30m" )
307
- }, 3 * time .Minute )
308
- if ! found {
309
- errChan <- fmt .Errorf ("relaxed timeout was not applied within 3 minutes ON A SECOND CLIENT" )
310
- return
311
- } else {
312
- p ("Relaxed timeout applied on second client" )
313
- }
314
304
// Signal success
315
305
errChan <- nil
316
306
}()
317
307
commandsRunner .FireCommandsUntilStop (ctx )
318
-
308
+ // wait for moving on first client
309
+ // once the commandRunner stops, it means a waiting
310
+ // on the logCollector match has completed and we can proceed
311
+ if ! found {
312
+ ef ("MOVING notification was not received within 3 minutes" )
313
+ }
319
314
movingData := logs2 .ExtractDataFromLogMessage (match )
320
315
p ("MOVING notification received. %v" , movingData )
321
316
seqIDToObserve = int64 (movingData ["seqID" ].(float64 ))
0 commit comments