@@ -297,12 +297,6 @@ func TestPushNotifications(t *testing.T) {
297297 // once moving is received, start a second client commands runner
298298 p ("Starting commands on second client" )
299299 go commandsRunner2 .FireCommandsUntilStop (ctx )
300- defer func () {
301- // stop the second runner
302- commandsRunner2 .Stop ()
303- // destroy the second client
304- factory .Destroy ("push-notification-client-2" )
305- }()
306300
307301 p ("Waiting for MOVING notification on second client" )
308302 matchNotif , fnd := tracker2 .FindOrWaitForNotification ("MOVING" , 3 * time .Minute )
@@ -393,11 +387,15 @@ func TestPushNotifications(t *testing.T) {
393387
394388 p ("MOVING notification test completed successfully" )
395389
396- p ("Executing commands and collecting logs for analysis... This will take 30 seconds... " )
390+ p ("Executing commands and collecting logs for analysis... " )
397391 go commandsRunner .FireCommandsUntilStop (ctx )
398- time .Sleep (time .Minute )
392+ go commandsRunner2 .FireCommandsUntilStop (ctx )
393+ go commandsRunner3 .FireCommandsUntilStop (ctx )
394+ time .Sleep (30 * time .Second )
399395 commandsRunner .Stop ()
400- time .Sleep (time .Minute )
396+ commandsRunner2 .Stop ()
397+ commandsRunner3 .Stop ()
398+ time .Sleep (5 * time .Minute )
401399 allLogsAnalysis := logCollector .GetAnalysis ()
402400 trackerAnalysis := tracker .GetAnalysis ()
403401
@@ -473,7 +471,7 @@ func TestPushNotifications(t *testing.T) {
473471
474472 // unrelaxed (and relaxed) after moving wont be tracked by the hook, so we have to exclude it
475473 if trackerAnalysis .UnrelaxedTimeoutCount != allLogsAnalysis .UnrelaxedTimeoutCount - allLogsAnalysis .UnrelaxedAfterMoving {
476- e ("Expected %d unrelaxed timeouts, got %d" , trackerAnalysis .UnrelaxedTimeoutCount , allLogsAnalysis .UnrelaxedTimeoutCount )
474+ e ("Expected %d unrelaxed timeouts, got %d" , trackerAnalysis .UnrelaxedTimeoutCount , allLogsAnalysis .UnrelaxedTimeoutCount - allLogsAnalysis . UnrelaxedAfterMoving )
477475 }
478476 if trackerAnalysis .RelaxedTimeoutCount != allLogsAnalysis .RelaxedTimeoutCount - allLogsAnalysis .RelaxedPostHandoffCount {
479477 e ("Expected %d relaxed timeouts, got %d" , trackerAnalysis .RelaxedTimeoutCount , allLogsAnalysis .RelaxedTimeoutCount )
0 commit comments