From f5345a0d9699d11b578e5d314dc47fcd99558e54 Mon Sep 17 00:00:00 2001 From: Nick Dowell Date: Thu, 1 Jul 2021 11:58:34 +0100 Subject: [PATCH] Retry launch_app to fix OOM flakes --- features/steps/ios_steps.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/features/steps/ios_steps.rb b/features/steps/ios_steps.rb index 8ae8f4a1b..a220c0090 100644 --- a/features/steps/ios_steps.rb +++ b/features/steps/ios_steps.rb @@ -69,7 +69,12 @@ def click_if_present(element) system("killall #{app} > /dev/null && sleep 1") Maze.driver.get(app) else - Maze.driver.launch_app + begin + Maze.driver.launch_app + rescue + # Retry because launch_app can fail when performed immediately after an app has stopped running. + Maze.driver.launch_app + end end end