From d614cf426d72ff40d39cc0385b68444739e62ae6 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 21 Jun 2021 10:36:26 +0200 Subject: [PATCH] MOBILE-3320 behat: Trigger change detection once Doing it multiple times seems to cause some internal race conditions in Angular that result in flaky tests --- tests/behat/behat_app.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/behat/behat_app.php b/tests/behat/behat_app.php index 966af9496..69126df33 100644 --- a/tests/behat/behat_app.php +++ b/tests/behat/behat_app.php @@ -793,11 +793,8 @@ class behat_app extends behat_base { new ExpectationException('Forced cron tasks in the app took too long to complete', $session) ); - // Trigger Angular change detection multiple times in case some changes have - // side-effects that result in further pending operations. - for ($ticks = 5; $ticks > 0; $ticks--) { - $session->executeScript($this->islegacy ? 'appRef.tick();' : 'changeDetector.detectChanges();'); - } + // Trigger Angular change detection + $session->executeScript($this->islegacy ? 'appRef.tick();' : 'changeDetector.detectChanges();'); } /**