Skip to content

Commit b55cdad

Browse files
committed
wait more in e2e test
1 parent 09a2f07 commit b55cdad

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

maintnotifications/e2e/scenario_push_notifications_test.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -375,7 +369,6 @@ func TestPushNotifications(t *testing.T) {
375369
p("[NOTICE] Expected timeS < 15, got %d", mNotifTimeS)
376370
}
377371
}
378-
commandsRunner3.Stop()
379372
// Wait for the goroutine to complete and check for errors
380373
if err := <-errChan; err != nil {
381374
ef("Second client goroutine error: %v", err)
@@ -395,9 +388,13 @@ func TestPushNotifications(t *testing.T) {
395388

396389
p("Executing commands and collecting logs for analysis... This will take 30 seconds...")
397390
go commandsRunner.FireCommandsUntilStop(ctx)
398-
time.Sleep(time.Minute)
391+
go commandsRunner2.FireCommandsUntilStop(ctx)
392+
go commandsRunner3.FireCommandsUntilStop(ctx)
393+
time.Sleep(30 * time.Second)
399394
commandsRunner.Stop()
400-
time.Sleep(time.Minute)
395+
commandsRunner2.Stop()
396+
commandsRunner3.Stop()
397+
time.Sleep(5 * time.Minute)
401398
allLogsAnalysis := logCollector.GetAnalysis()
402399
trackerAnalysis := tracker.GetAnalysis()
403400

@@ -473,7 +470,7 @@ func TestPushNotifications(t *testing.T) {
473470

474471
// unrelaxed (and relaxed) after moving wont be tracked by the hook, so we have to exclude it
475472
if trackerAnalysis.UnrelaxedTimeoutCount != allLogsAnalysis.UnrelaxedTimeoutCount-allLogsAnalysis.UnrelaxedAfterMoving {
476-
e("Expected %d unrelaxed timeouts, got %d", trackerAnalysis.UnrelaxedTimeoutCount, allLogsAnalysis.UnrelaxedTimeoutCount)
473+
e("Expected %d unrelaxed timeouts, got %d", trackerAnalysis.UnrelaxedTimeoutCount, allLogsAnalysis.UnrelaxedTimeoutCount-allLogsAnalysis.UnrelaxedAfterMoving)
477474
}
478475
if trackerAnalysis.RelaxedTimeoutCount != allLogsAnalysis.RelaxedTimeoutCount-allLogsAnalysis.RelaxedPostHandoffCount {
479476
e("Expected %d relaxed timeouts, got %d", trackerAnalysis.RelaxedTimeoutCount, allLogsAnalysis.RelaxedTimeoutCount)

0 commit comments

Comments
 (0)